1- Script general structure and usage

General information

Scripts written with the Script Editor are defined in the Terminal Parameters section of the Sys application and are valid for all users. A specific script is selected for the user on the User Definitions screen in the Sys application, and user-specific processes can be executed.

When a user logs into the system via the handheld terminal, a user-specific script, if any, or a general script starts to execute.

Scripts run in a session and the execution and the variables are saved until the user logs out. When the script changes, it is sufficient to restart the user session.


Script structure

Scripts consist of forms and commands written in the forms. All forms begin with BeginForm(Form name) and end with EndForm command. Turkish characters are not used in form names.

Only the first defined form is automatically executed in the script (excluding rule definitions). Other forms must be called from this first form or directed through each other. Two methods are used to call the forms: 1- Go to the form and continue there (GoForm) 2- Go to the form and return when the job is done. (CallForm)

Tags can be defined within forms to segment commands or redirect. Tags are created with a : (colon) at the end of the tag name.

Scripts are executed line by line.


Variables

All variables are global. Once defined and assigned a value, the variable can be used anywhere in the script. When it is requested to use a variable for different purposes, that variable should be assigned a new value or the value of the variable should be reset.

Two types of variables are used in the script: User-defined variables and variables of business objects.

User-defined variables begin with the @ sign. Defining and assigning values are performed with Set command or with commands whose results can be assigned to variables. If a variable is not defined at all, it is automatically defined when first assigning a value.

Variables for business objects begin with the @@ sign and their names are fixed. (See. Operations of database objects) Assigning values ​​to these variables can be performed automatically by the relevant commands or by specifying them by the user. Some commands also automatically fill in other variables that are affected by the original process.

The number 2 is added to the end of the name of the variables of the "target" type of objects that can be used as "source/target" in the product. For example: @@Warehouse for the source warehouse, @@Warehouse2 for the target warehouse.

The variables can be used in the text. For example: Text(1,1,"Name: @name")

There are several general variables defined for telnet application.

  • @SCREEN_WIDTH : Number of columns on the screen
  • @SCREEN_HEIGHT : Number of lines on the screen
  • @Style : Variable that allows formatting color, line, width, etc.


Spelling

All commands, with or without parameters, are used with parentheses next to them. Ex. Beep(), EndIf(), EndForm()

At the end of the line, the ; (semicolon) sign is not used.

The = (equal) sign is not used in assigning values to variables. Variables are assigned values with the Set command. For example: There is no such use as @a=1. However, the equality check is performed with the = sign. For example: If(@a=1,...)

There is no case sensitivity. However, as it can cause problems for Turkish characters, CamelCase (Capital Initials) is recommended. For example: WorkOrder.List()

Texts must be written between "" (double quote). When numbers are written between double quotes, it is still considered a number if it is expected to write numbers as a parameter in the relevant commands.

JSON expressions must be written between {} (curly brackets).

The // (two italic slashes) sign is used for comments and comment lines to be ignored in the script.

Each line is interpreted as a separate command. For this reason, any command is not written on multiple lines.