List of Methods by Category
This
Click on a Method in the list below to display a description of that Method. Within the Method descriptions, the following conventions are used:
[...] = optional items which can be omitted when calling the Method.
<...> = the type of data which should be substituted for the bracketed item when calling the Method, e.g. <filename> would indicate that the item should be replaced with a string or variable containing an appropriate file name.
In both cases the brackets are purely for information purposes in the descriptions and should not be included when calling the Method within a Script.
-
Method names are not case-sensitive.
Forms in Digitise Apps are similar to forms in Microsoft Visual Studio and are containers of controls. At runtime, only one form can be displayed at a time.
GetCurrentForm Obtain the name of the current form.
GetPreviousForm Obtain the name of the previous form.
SetNextForm Set the next form to display when the current Script exits.
SetFormBackColour Set the current form's background colour.
SetFormTitle Set the current form's title.
Controls in Digitise Apps are similar to controls in Microsoft Visual Studio and may be mapped to data elements within a Data Source. Controls can be output mapped, in which case values can be read from the controls and written to the current record of Database Data Sources or used as input parameters to Web API and Web Service Data Sources. Controls can also be input mapped, in which case values can be written to the controls from a current record by calling RefreshControls.
RefreshControls Update input value(s) in one or all controls from the current record and send data to a Web Service.
ClearControl Clears the contents of a control or all controls.
GetControlValue Obtain the current value of a control.
GetSelectedIndex Determine the currently selected item in a Combo Box, List Box or ListView Control.
GetSelectedText Obtain the value of the currently selected item in a Combo Box, List Box or ListView Control.
SetSelectedIndex Select an item within a List Box, Combo Box or ListView Control based on its position within the list.
SetSelectedValue Select an item within a List Box, Combo Box or ListView Control based on the item's content.
GetListItems Obtain current contents of a Combo Box, List Box or ListView Control.
SetControlFocus Move the Focus to a specified control.
SetControlEnabled Enable or disable a control.
GetControlEnabled Check whether a control is currently enabled or disabled.
SetControlVisible Hide or show a control.
SetControlTextColour Set the colour of text for a control.
SetControlBackColour Set a control's background colour.
SetControlValue Set the value of a control to a specified string value.
SetControlImage Set the image file name for a Picture & Video Control.
SetTimerInterval Set the timer interval for a Timer Control.
SetGlobalTimerInterval Enable/disable the Global Timer and configure time interval.
Data access is controlled by the use of Data Sources, Custom Views and Records.
A Data Source is defined in App Studio and is the definition for the interface between a Target database, Web API, web service, Outlook Contacts or Appointments or a Custom Table and your mobile app. Controls on your forms are mapped to elements within the Data Sources as output or input. Output values are written to the Target data source, and input values are read from the Target data source whenever a data update or refresh call is made on a Data Source.
A Custom View is also defined in App Studio and provides a window onto the data stored locally on the mobile device. A Custom View effectively allows you to select a set of records from all the records stored locally in your Digitise Apps Client database and to query and display the values contained within those records. The record set contained within a View is chosen using a SQL Select statement and can contain records from a single database table or combine data from multiple different tables. The record set within a View is not physically stored in its own separate table. You can use a Custom View in place of a Data Source in Data Access Methods which aren't related to or don't perform data transfers, record updates or new record creation.
You must define any Data Source or Custom View within App Studio before you can reference it within the Script Methods.
Many of the Data Access Methods require you to specify one or more Data Sources or Custom Views as parameters to the Method.
Unless stated otherwise in the Method definition, when a Method requires such a parameter, you specify it as follows:
ADO Database Data Sources <datasourcename>.<tablename>
Web Services Data Sources <datasourcename>
Custom Tables Custom.<tablename>
Custom View Custom.<viewname>
Outlook Contacts and Appointments
(Predefined Data Sources) <datasourcename>.<tablename>
e.g. Outlook.Contact, Outlook.Appointments
where:
-
<datasourcename> is the Name of a Data Source as defined within App Studio.
-
<tablename> is the name of the Table within the Data Source.
In all Methods which take a Data Source parameter, you can specify the parameter as a string value or specify a variable, either of which must contain the Data Source name in the appropriate format from the list above.
- Check Box and Radio Buttons must have checked and unchecked output values defined in App Studio. These values are used to define the data values sent or received that represent the checked/unchecked states of these controls.
When transferring data between a remote data source and your app, there is a maximum upload/download size of 4GB.
Synchronise Perform background or foreground data transfers to and from the device and a remote Target database.
IsRetrySyncAvailable Check whether the Digitise Apps Client received a response from the App Server to the last call to Synchronise or SyncDataSource.
RetrySync Requests the App Server to send its response to the last Synchronise or SyncDataSource call to the Digitise Apps Client.
SyncDataSource Write modified records from local database to a Target data source.
LoadDataSource Download data from a Target data source and, if Target data source is a Web Service, send data to the Web Service.
LoadDatabase Download data from a Target data source with option to assemble data into database on App Server before downloading to mobile device.
SetSelectString Specify record selection for use in other Methods.
IsDataSourceLocked Check to see whether a local table is locked and hence cannot be written to.
GetTransactionProgress Obtain the current percentage completed of an asynchronous data transfer.
GetTransactionState Obtain the current status of an asynchronous data transaction.
CancelTransaction Cancel synchronising data.
DropDataSource Delete Data Source table(s) from the local database on the mobile device.
SelectLocal Copy records from one local database table to another.
GetDataSourceParam Check the value of a configurable element within a specified Data Source's connection string.
SetDataSourceParam Modify a specified Data Source's connection string.
ClearDataSourceParams Clears a configurable Data Source connection string value and reverts to using the original value.
GetNumSyncErrors Used to query whether there are any error messages after a call to the Synchronise Method.
GetSyncErrorDataSource Obtain the Data Source to which an error relates after a call to Synchronise.
GetSyncErrorDescription Obtain the description of an error awhich fter a call to Synchronise.
GetSyncErrorRecordIndex Obtain the record index to an error relates after a call to Synchronise.
Records in Digitise Apps are similar to records in any data environment in that they represent a row or single element within a Data Source. Controls are always bound to the current record; they must be refreshed, however, before new data is displayed. Record order will be as returned by the Web Service or as retrieved by a SQL Select statement for the database.
- The current record for a ListView Control reflects the currently selected item.
UpdateCurrentRecord Mark current record as modified and update local database on mobile device.
GetCurrentRecordValue Obtain the value of a specified field within the current record.
GetRecordValue Obtain the value of a field within a specified record.
SetCurrentRecordValue Enter a value into a field within the current record.
SetRecordValue Enter a value into a field within a specified record.
GetColumnSize Obtain the size of the data in a binary column for the current record or all records.
FindRecord Search a Data Source for a particular record.
GetCurrentRecordIndex Obtain the index of the current record.
SelectRecord Make a record the current record.
SelectFirstRecord Make the first record the current record.
SelectLastRecord Make the last record the current record.
SelectNextRecord Make the next record the current record.
SelectPriorRecord Make the previous record the current record.
IsRecordModified Check whether a particular record has been modified.
GetModifiedRecords Find the number of records that have been modified in a Data Source.
GetNumRecords Find the number of records contained in a Data Source.
GetNumRecordsWhere Find the number of records in a Data Source which match a specified search string.
ReadColumnFromFile Read a file and write contents to a data record column.
WriteColumnToFile Append a column in the current record to a local file.
WriteRecordToFile Append the current record to a file.
CreateRecord Create a new blank record and make it the current record.
DeleteRecord Delete the current record in a local database.
These Methods are designed to allow you to read and write values to and from individual elements within an XML string stored in a single column of a Data Source record.
ReadXMLValues Extract elements from an XML string stored in a Data Source.
GetXMLValue Read values extracted from an XML string by the ReadXMLValues Method.
SetXMLValue Write values into an XML string stored in a Data Source.
The Date and Time Methods behave in a similar way to their VBScript equivalents.
If you are upgrading from a version of Digitise Apps' predecessor MX, these Methods were updated in MX v10 to provide consistency across all Platforms. If you have MX apps created in earlier versions of MX you can retain the previous method of operation using the Use Cross-Platform Date Functions Property in the Project Properties. If this Property is set to True, the newer Methods will be used. If set to False, the older Methods will be used. By default, this Property is set to True for new Projects (and those upgraded from MX v10 or later) and False for Projects created in a version of App Studio pre-MX v10.
Hour Obtain the hour value from a date\time string.
Minute Obtain the minute value from a date\time string.
Second Obtain the seconds value from a date\time string.
Weekday Obtain the day of the week value from a date string and return as a number from 1 to 7.
Day Obtain the day of the month value from a date\time string, in numeric format.
Month Obtain the month value from a date\time string, in numeric format.
Year Obtain the year value from a date\time string.
WeekdayName Return the name of a day of the week from its numerical equivalent.
MonthName Return the name of a month from its numerical equivalent.
DateAdd Add a time interval to a date string.
DateDiff Calculate the time interval between two date strings.
DatePart Obtain a specified part of a date string.
IsDate Check whether a string contains a date.
Now Obtain the current system date and time.
The parameters to these Methods can be expressed as a number, a variable or a call to another Method. You can also use the Arithmetic Operators within an individual parameter expression. Floating point numbers are supported.
Digitise Apps doesn't require variables to be declared with a specific data type, such as string, long, double etc. Consequently, in the Method definitions the return value is not specified as a specific data type and could be an integer or a floating point positive or negative number.
Abs Obtain the absolute value of a number.
Fix Obtain the integer part of a number.
Round Round a number to a specified number of decimal places.
Rnd Randomly generate a number.
Sqr Obtain the square root of a number.
Pow Raise one number to the power of another.
Exp Obtain e raised to a specified power.
Log Obtain the natural logarithm of a number.
Sin Obtain the sine of an angle.
Cos Obtain the cosine of an angle.
Tan Obtain the tangent of an angle.
Atn Obtain the arctangent of an angle.
Chr Convert a decimal value to a character.
IsAlpha Check whether a string contains only alphabetic characters.
IsDigit Check whether a string contains only numeric characters.
IsNumeric Checks whether a string contains a decimal numeric value.
IsWhitespace Check whether a string contains only whitespace characters.
IsNull Checks whether a string, variable or expression is equal to NULL.
Len Count the number of characters in a string.
Left Return part of a string starting from the beginning
Mid Return part of a string starting from a specified position.
Right Return part of a string starting from the right-hand end.
LTrim Remove whitespace characters from the left-hand side of a string.
RTrim Remove whitespace characters from the right-hand side of a string.
Trim Remove whitespace characters from both ends of a string.
LCase Convert a string to lower-case.
UCase Convert a string to upper-case.
Instr Check for the first occurrence of one string within another starting at beginning of string.
InStrRev Check for the first occurrence of one string within another starting at end of string.
Replace Replace all or part of a string with another string.
StrReverse Reverse a string.
String Returns a string consisting of a repeating character.
RegEx Allows you to compare a string against a 'regular expression'.
GPSStart Open a COM Port and start reading GPS data.
GPSStop Close a GPS COM Port and stop reading GPS data.
GetGPSState Check the current state of the GPS port and whether a valid Fix is available.
GetGPSValue Take GPS reading.
SetApplicationOption Specify various settings which affect how the camera and progress bar operate.
GetApplicationOption Obtain the value of an application option set using SetApplicationOption.
GetDeviceType Query the type of device the Digitise app is running on.
GetUser Find the currently logged-in user.
GetApplicationName Obtain the name of the current Digitise app.
GetCurrentNetworkType Query the type of network currently in use.
GetCurrentServer Obtain the address details of the machine running the App Server you are connected to.
GetDeviceName Obtain the device's name.
GetDeviceId Obtain the device's ID.
GetSystemInfo Obtain version information or screen size and orientation.
IsNetworkAvailable Check to see whether the network is available.
IsServerAvailable Check to see whether an App Server is available.
MsgBox Display a message box.
GetDeviceCapabilities Check whether device has a Camera and GPS support.
TakePhoto Allow the user to take a photo.
ScanBarCode Scan a Bar Code.
DeleteFile Delete a file on the mobile device.
DeleteFolder Delete a Folder on the device
Exec Execute a command.
LaunchApplication Run another Digitise app from within the currently running Digitise app.
GetStartupParameter Obtain the parameter string passed to a Digitise app launched by another Digitise app.
PlaySound Play a wav file.
SendEmail Send an e-mail.
SendSMS Send a text message.
GetTelephoneNumber Obtain telephone number from SIM card.
DialTelephone Dial a telephone number.
Vibrate Make the device vibrate.
GetBatteryLevel Check the current battery level.
ScaleDataSourceImage Create a scaled version of an image.
WriteFile Append a string to a file.
AddSystemNotification Display Alerts and Reminders.
RemoveSystemNotification Cancel a previously configured alert or reminder.
GetPushNotificationPayload Obtain the data contained in the value field associated with the specified key from the JSON payload contained in a push notification.
GetPushToken Obtain the current push token value.
RegisterForPush Attempt to register an app with the appropriate push notification service for the type of Device.
CreateHash Create a hash value from a specified string.
GetAccessToken Obtain the OAuth Access Token for the currently logged in user.
SetDataErrorOn Turn data error reporting on.
SetDataErrorOff Turn data error reporting off.
GetLastError Obtain information about the last error which occurred.
GetLastErrorLine Obtain Script line on which the last error occurred.
GetLastErrorType Obtain category of error for the last error which occurred.
GetLastDataError Obtain information about the last data error which occurred.
ExitApplication Close the current Digitise app.
ExitClient Close all running Digitise apps and then close down the Digitise Apps Client.