$Setg: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (Mlarocca moved page $SETG to $Setg: Lower case change)
(No difference)

Revision as of 18:54, 29 July 2014

The $SETG function performs two tasks. It attempts to create or change an entry in the global variable table and also informs the user if the operation was successful. $SETG returns a 1 (true) if the global variable was not stored due to lack of space. It returns a 0 (false) if the variable was successfully stored.

$SETG takes two arguments. The first argument contains the name of the global variable; the second argument contains the value. Previously stored variables with the same name are deleted first.

Example

The following statement attempts to store a global variable with a name of GLOB and with a value equal to the character string returned from the $READ. A message is to be printed if the operation was not successful.

IF $SETG('GLOB',$READ('ENTER GLOBAL VALUE')) THEN PRINT 'HELP' END IF

Refer to Global features for a detailed explanation of global variables and examples of the $SETG function within a request.