Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Scripts are typically divided into two parts: the Declaration Part and the Program Part. The declaration part is used to establish internal variables and input parameters. The program part includes all program statements outside of the variable declarations.

Users can place comments anywhere in the comments by placing a ‘/*’ at the start of the comment and a ‘*/’ at the end of the comment.

Ex: /* This is the proper structure for a comment */

(1) Declaration Part

Item

Description

Variable Declaration

Declare internal variables using the following format:

var variable_name;

The initial value of declared variables is 0. To declare more than one variable, use a comma “ , ” between variables:

var variable_name_1, variable_name_2,, variable_name_n;

Users can use multiple VAR keywords before the program part starts.

Users can also define an initial value for the variable when declaring it using the following format:

var variable_name = 1;

(2) Program Part

In the program part, all program statements except the declaration (variables and parameters) can be used. An example of the most basic statement is the function call, calculation, and storing of the result.

The following program example is composed of basic statements.

var_a = var_a + 1;

var_b = MyPgm(var_a, 2, 3);

Each statement must end with a semicolon “ ; ”. Each function returns a single result to the caller. The program shown above returns the result of MyPgm to “var_b”.

  • No labels