Writing Scripts
A Script consists of any number of lines of code, which will be executed by the Digitise Apps Client when the Event it is assigned to occurs during operation of the program.
The code within a Script can include:
- Comments - lines which are ignored and not executed when the Script runs. Generally used to provide information about what is happening in the Script to make understanding the Script easier when looked at later or by another developer.
- Functions - one or more lines of code grouped together in a discrete unit. Used to divide the code into manageable chunks and to separate tasks or features to prevent having to repeat code segments and to make the Script easier to read and understand.
- Methods - functions provided with the Script Editor in a library which can be accessed from within your Script to prevent you having to write these functions yourself. The Methods include form navigation, data access, form and control Property management and string and number manipulation.
- Variables - data holders whose current value can be changed during the execution of the Script.
- Control Properties - each Control has a set of Properties allowing you to define how the Control operates. Some Properties can be accessed in your Scripts wherever a variable could be used.
- Language Statements - one or more lines of code including predefined reserved words which affect the operation of the Script. The Language Statements mainly control the order in which the lines of code are executed, e.g. to execute different lines of code depending upon the result of checking a specified condition, repeatedly execute the same code until a specified result is reached and break out of the code or Script early.
- Operators - allow you to manipulate numbers and text, compare values and set one item equal to the value of another.
To create or edit your Script, you select the appropriate Event within the Script Editor and simply enter the lines of code to perform the actions you want the Script to achieve.
You can use tabs to indent lines and make reading your Script easier.