Please enable JavaScript to view this site.


Navigation: Macros > Macro Language > Code Structure

The var Macro Code Section

Scroll Prev Up Next More

The var section of a macro is where a macro's local variables are declared.


By local variable we mean any variable whose value is set and kept locally in the macro (in comparison to input variables whose values are supplied by the script or global variables whose values are maintained outside the macro from one iteration to the next).


Variables in the var section are declared by listing them in the declaration block.


You do not need to declare the type of the variables, since it is determined by the first letter of the variable name.

Do not use any separators such as commas to separate the variable.

Note that the list of variable can extend onto as many lines as you wish.


This section, even if it is empty, is compulsory.

   // use nDate

Below is an example of a macro without any local variables.

   // the var section, even if empty, must still be there
   // instructions do not require any local variables

See also: variables and code structure.


Topic 133400, last updated on 18-Apr-2020