Quick Reference

From GAB Help
Jump to: navigation, search

Passed Variable Information

Function.Intrinsic.Variable.AddPV(Name,value)
Function.Intrinsic.Variable.AddRV(Name,Value) 

Adding a Break in the Program

Program.Sub.Control.Stop or ctrl + b (on a blank line in the code)

Calling/Exiting Sub within Subroutine

Function.Intrinsic.Control.CallSub (Subname)
Function.Intrinsic.Control.CallSub (Subname, Arg Name, Arg Value, …)
Function.Intrinsic.Control.ExitSub (SubName) 

String Information

Function.intrinsic.String.Replace(passed string, match string, replace string, return string)
Function.Intrinsic.String.Concat(String,String,...,Ret String) 

File Information

Function.Intrinsic.File.Exists(Path,Return Var boolean)
Function.Intrinsic.File.GetHandle(Long Return Variable)
Function.Intrinsic.File.OpenForRead(FQ FileName, Handle)
Function.Intrinsic.File.OpenForAppend(FQ FileName, Handle)
Function.Intrinsic.File.OpenForWrite(FQ FileName, Handle) – use this for writing and also for reading a table that has a memo field
Function.Intrinsic.File.ReadFile(Handle, Return Variable)
Function.Intrinsic.File.WriteLine(Handle, Text)
Function.Intrinsic.File.CloseFile(Handle) 

Control Information

Function.Intrinsic.Control.For(Name var,Start#,End#,Step)
Function.Intrinsic.Control.Next(Name Var)
Function.Intrinisc.Control.If(variable,=<>,value)
Function.Intrinisc.Control.ElseIf(variable,=<>,value)
Function.Intrinisc.Control.EndIf
Function.Intrinsic.Control.Do
Function.Intrinsic.Control.DoUntil(1st Arg, Evaluation Criteria, 2nd Arg)
Function.Intrinsic.Control.Loop
Function.Intrinsic.API.SetControlFocus(Variable.Passed.######.HWnd) 

Recordset/Database Information

Function.ODBC.Connection!Con.openconnection(DSN,Name,username,password)
Or
Function.ODBC.Connection!connection_name.OpenConnection(DSN, username, password, timeout)
Or
Function.ODBC.Connection!connection_name.OpenConnection(variable.ambient.PDSN, variable.ambient.Puser, variable.ambient.Ppass) – This is for internal use only, if the user gets a script and resaves it then they will need to put in their actual DSN Name, Username and Password for the script to run properly.
Function.ODBC.Connection!con.openRecordSetRO/RW(rst,Table or SQL)
Function.ODBC.Con!rst.addnew
Function.ODBC.Con!rst.close
Function.ODBC.Con!rst.movenext
Function.ODBC.Con!rst.update
Function.ODBC.Con!rst.set!fieldName(“Value”)
Function.ODBC.Connection!Con.Execute(SQL Statement)
‘Use this to confirm that a table exists before trying to open or update the table, to prevent errors.
Function.ODBC.Connection!con.TableExists(Table Name, Boolean return) 

Read Database Information

Variable.ODBC.ConnectionName.State
Variable.ODBC.ConnectionName!RecordsetName.EOF
Variable.ODBC.ConnectionName!RecordsetName.FieldCount
Variable.ODBC.ConnectionName!RecordsetName.FieldType!FieldName
Variable.ODBC.ConnectionName!RecordsetName.FieldVal!FieldName 

Datebase Field Transforms

‘Returns Boolean for Null value check
Variable.ODBC.ConnectionName!RecordsetName.FieldValIsNull!FieldName
‘Returns a float value
Variable.ODBC.ConnectionName!RecordsetName.FieldValFloat!FieldName
‘Returns Boolean for Numeric check of the field
Variable.ODBC.ConnectionName!RecordsetName.FieldValIsNumericl!FieldName
‘Returns the left nn characters of a passed string
Variable.ODBC.ConnectionName!RecordsetName.FieldValLeftnn!FieldName
‘Returns a long value
Variable.ODBC.ConnectionName!RecordsetName.FieldValLong!FieldName
‘Returns the string with left spaces removed
Variable.ODBC.ConnectionName!RecordsetName.FieldValLTrim!FieldName
‘Returns the ordinal of the field
Variable.ODBC.ConnectionName!RecordsetName.FieldValOrdinal!FieldName
‘Returns a string for the pervasive date format
Variable.ODBC.ConnectionName!RecordsetName.FieldValPervasiveDate!FieldName
‘Returns the right nn characters of a passed string
Variable.ODBC.ConnectionName!RecordsetName.FieldValRightnn!FieldName
‘Returns a string with right spaces removed
Variable.ODBC.ConnectionName!RecordsetName.FieldValRTrim!FieldName
‘Returns a string
Variable.ODBC.ConnectionName!RecordsetName.FieldValString!FieldName
‘Returns a string with left and right spaces removed
Variable.ODBC.ConnectionName!RecordsetName.FieldValTrim!FieldName 

GS Screen Modification

Function.Intrinsic.Debug.ShowCallerInfo       This function shows all the controls passed to GAB
Variable.passed.controlnumber.set(“Value”)     This sets the text or caption to the value
Function.Intrinsic.UI.ChangeCallerProperty(Variable.Passed.ControlNumber,"Hide",1) This changes the property of the passed control, other options instead of Hide are Tabstop and Lock. 

UI Information

Function.Intrinsic.Ui.Msgbox(Prompt,[Title],[Flag],[return variable])
Method 1 - Browser
Function.Intrinsic.UI.Browser(Title, connection, Basis, Column Titles, Column Widths, String Return)
Method 2 - Browser
Function.Intrinsic.UI.Browser(Title, connection, Basis, Column Titles, Column Widths, Width of Browser, Height of Browser, String Return)
Function.Intrinsic.UI.InputBox (Prompt, Title, Default, Return Variable) 

Declare/Calling Variable within code and from GAB screen

variable.local.name.declare(datetype)            datatype=string, long, boolean, date, float
variable.local.name.set(value or variable)            use this to set the variable.
variable.local.name                     use this as return variable 
variable.screen.formname!controlname.property        use this to get the property info from a GAB screen  

Variable Transforms

This is for Local, Global, and Static (just replace local in the examples below with the type being used)

‘Decreases a long by one, this is temporary would be used when finishing filling an array from a loop and wanting to redim preserve to one less than the counter
Variable.Local.Name.--
‘Adds one to the variable, this is temporary 
Variable.Local.Name.++
 ‘Declares the variable
Variable.local.name.Declare
‘Returns variable data as float
Variable.local.name.Float
‘Returns if the variable is a date
Variable.local.name.IsDate
‘Returns if the variable is numeric
Variable.local.name.IsNumeric
‘Returns the Lbound of the Variable if it is an array
Variable.local.name.Lbound
‘Returns variable data in lower case
Variable.local.name.Lcase
‘Returns the left most nn characters of the passed string.
Variable.local.name.leftnn
‘Returns variable data length
Variable.local.name.Length
‘Returns variable data as a long
Variable.local.name.Long
‘Returns variable data with leading spaces removed
Variable.local.name.Ltrim
‘Returns variable data in Proper Case
Variable.local.name.Pcase
‘Returns variable data as a Pervasive Date
Variable.local.name.PervasiveDate
‘Returns variable data with the end spaces removed
Variable.local.name.Rtrim
‘Redims an array, this will remove existing data, and fill with new data
Variable.local.name.ReDim
‘Redims an array keeping the existing data intact, and allowing the user to add to the Ubound of the array
Variable.local.name.ReDimPreserve
‘Returns the right most nn characters of the passed string.
Variable.local.name.Rightnn
‘Sets data for the variable
Variable.local.name.Set
‘Returns variable data as a string
Variable.local.name.String
‘Returns variable data as string literal
Variable.local.name.StrLit
‘Returns variable data without leading and trailing spaces
Variable.local.name.Trim
‘Returns upper bound of the array
Variable.local.name.Ubound
‘Returns variable data as upper cased
Variable.local.name.UCase 

Controls from Screen Painter

Gui.Fomrname.controlname.property(value or variable)
Variable.screen.formname!controlname.value 

Security Calls

Function.Global.Security.GetAllUsers(string return variable)
Function.Global.Security.GetAllUsers(Company code, string return variable)
The return is a *!* delimited string. Use F.in.String.Split to parse it
Function.Global.Security.GetFullName(string return variable)
Function.Global.Security.GetFullName(Company code, string return variable)
Function.Global.Security.GetUserEmail(string return variable)
Function.Global.Security.GetUserEmail(Company code, string return variable)
Function.Global.Security.IsInGroup(User, Group, bool return variable)
Function.Global.Security.IsInGroup(User, Group, Company code, bool return variable)
Function.Global.Security.GetGroupMembers(Group, string return variable)
Function.Global.Security.GetGroupMembers(Group, Company code, string return variable)
The return is a *!* delimited string. Use F.in.String.Split to parse it
Function.Global.Security.GetUserGroups(User, string return variable)
Function.Global.Security.GetUserGroups(User, Company code, string return variable)
The return is a *!* delimited string. Use F.in.String.Split to parse it
Function.Global.Security.GetGroupEmails(Group, string return variable)
Function.Global.Security.GetGroupEmails(Group, Company code, string return variable)
The return is a *!* delimited string. Use F.in.String.Split to parse it 

Notes

  • The Pervasive version of Global Shop is a prerequisite for the use of these commands
  • The appropriate DSN must be present on the client machines for these commands to work
  • These commands default to the current company code, if none is provided