$Setg_Sys_List

From m204wiki
Revision as of 01:28, 19 October 2012 by JALWiccan (talk | contribs) (1 revision)
Jump to navigation Jump to search

Get list of system-wide globals

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Setg_Sys_List function is the ListOfGlobals (System/Subsystem function).

This function returns names and values from the current set of system global variables. It may be useful in debugging situations.

The $Setg_Sys_List function accepts three arguments and returns zero, indicating success, or a number indicating the cause of error, if there is one.

The first argument identifies the $list to which items for the subsystem globals will be added. This is a required argument.

The second argument is the string which is used to separate the global name from its value in each item of the output $list. This is an optional argument; if omitted, or if the null string is supplied, it defaults to a single byte with value X'00'. This separator value (X'00') can be particularly useful for sorting the output $list; see $Setg_Subsys_List for an example with sorting.

The third argument is a pattern string; all system global variables matching this pattern are placed on the output $list. This is an optional argument; if omitted, all system global variables are placed on the output $list.

Syntax

<section begin="syntax" />%rc = $Setg_Sys_List(list_id, sep, glob_pat) <section end="syntax" />

$Setg_Sys_List Function

%RC is set to 0 or to an error indicator.

0 - No errors -3 - No room to create $list items (if LISTFC $SirParm parameter not set) -6 - $List identifier invalid

$Setg_Sys_List return codes

This function can be used for debugging, to retrieve values of selected system global variables. The names global variables can be specified using the following wildcard characters:

* Matches any number of characters including none
? Matches any single character
" Indicates that the next character must be treated literally even if it is a wildcard character.

The format of the items created by $Setg_Sys_List is as follows; ss is the length of the separator string, gg is the length of the global name, vv is the length of the global value:

Length Description ------ ---------------- 10 Blanks gg Global name ss Separator string vv Global value

For example, the following request displays information about the system global variables whose names start with the string 'DATE' or with the string 'EXPIRE'. A single slash character ("/") is used to separate the global name from the global value. (This example assumes that the combined length of the global name and value is less than 245.)

BEGIN %L FLOAT %X FLOAT %L = $ListNew %X = $Setg_Sys_List(%L, '/', 'DATE*') * Append more globals to $list: %X = $Setg_Sys_List(%L, '/', 'EXPIRE*') FOR %X FROM 1 TO $ListCnt(%L) PRINT $ListInf(%L, %X) END FOR END

This $function is new in Version 5.5 of the Sirius Mods.

Products authorizing $Setg_Sys_List