!SETVAR()

!SETVAR()

Top  Previous  Next

 

The !SETVAR() subroutine sets the value of a user defined @-variable. It can also update some standard @variables.

 

 

Format

 

CALL !SETVAR(name, value)

 

where

 

nameis the name of the @-variable to be set. The leading @ character may optionally be omitted. The name may be up to 32 characters and is case insensitive.

 

valueis the value to be set. This may not include the mark characters.

 

 

The !SETVAR() subroutine sets the value of the named user defined @-variable. It can also set other standard @variables that are not read-only (e.g. @USER0) though these can be set using simple assignment statements.

 

The !SETVAR() function sets a status value that can be retrieved using the STATUS() function. This will be zero if the action is successful, or a non-zero error code if the name is invalid.

 

 

Example

 

CALL !SETVAR("@MYVAR", 71)

 

This example sets the user defined @MYVAR to 71.

 

 

See the !ATVAR() subroutine for a way to retrieve the value of a user defined @-variable.