Type


 

By default variable type in Macro Scheduler is inferred. MacroScript is designed to be simple to understand for non-programmers and therefore does not force the developer to have to worry about type. All variables are usually stored as "variants" and their type is inferred from their value when comparisons are performed.

 

There is one way that this can be overridden and type can be forced. This is when assigning variables using complex expressions. E.g.:

 

Let>myString={"0123"}

 

Because the { ... } tokens have been used and the value has been quoted myString will be marked internally as being a string.  Thus when using a complex expression to compare to a string the complex expression will know that the value is a string:

 

If>{%myString% = "0123"}

 // yes

Endif

 

ArrayDim and Separate can also take an optional parameter to set the variable type.

 

Valid types are: string, integer, double

 

When setting a variable using the complex expression { .. } delimiters the type will be set. But when setting variables without they will continue to be variant and type will be inferred when used in complex expressions.

 

The function GetVarType will retrieve the type of a variable.