!ATVAR()

!ATVAR()

Top  Previous  Next

 

The !ATVAR() subroutine retrieves the value of an @-variable.

 

 

Format

 

CALL !ATVAR(value, name)

 

where

 

valueis the returned value.

 

nameis the name of the @-variable to be retrieved. The leading @ character may optionally be omitted. Variable names are case insensitive.

 

 

The !ATVAR() subroutine returns the value of the named @-variable. Although intended for accessing user defined variables, it can also return the standard variables.

 

The !ATVAR() function sets the value returned by the STATUS() function. This will be zero if the specified variable is found, non-zero if it is not recognised.

 

 

Example

 

CALL !ATVAR(VALUE, "@MYVAR")

 

or

 

DEFFUN ATVAR(NAME) CALLING "!ATVAR"

VALUE = ATVAR("@MYVAR")

 

Both of these examples retrieve the value of the @MYVAR variable.

 

 

See the !SETVAR() subroutine for a way to set the value of an updateable @-variable.