Variable DeclarationsThe variables name and data type must be declared before being used in computations. Examples: integer i1, i2=1, iA[]=new[5]; The second line declares a string s1, initialized to "abc" and not modifiable afterwards. sL is a list of string values, sLA is a list of arrays of strings, and m1 is a map. Special keywords delimit sets of declarations and statements that are executed as a block. These groups appear when conditional logic is used to control program flow, such as if-then-else operations or when loop constructs are used. It is also possible to create arbitrary blocks of instructions by placing them between BEGIN and END keywords. Each block of instructions creates a scope, and variables declared in the same scope must have an unique name. Variables defined in the outermost block (not nested in any block) are named global page variables. They are the only variables that can be referred in the response formatting phase, and must be used for final results. A set of predefined global variables will contain request input parameters, such as query arguments, posted data, or cookies. Variables are used in executable statements. |
|