VARSET Function

Sets a variable to a value. This allows the name of the variable to be immediately evaluated at run time.

Category: Macro Variable
Returned data type: Boolean

Syntax

VARSET(variablename, value)

Required Arguments

variablename

specifies the name of a variable that is to receive the value. variablename can be specified as a string.

Note: The string value of this parameter is used to figure out which variable to alter.

value

specifies the value to set to macroname; value can have a data type of real, integer, string, date, or Boolean.

Details

The function return TRUE if it successfully completes. Otherwise, it is set to FALSE.

Example

string myvar1
string myvar2
string myvar3
integer x
for x = 1 to 3
  varset("myvar" & x, "value is " & x)

// This should result in each string variable receiving
// a different value as assigned.