$Setg Subsys List: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(26 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Get list of subsystem-wide globals</span>
<span class="pageSubtitle">Get list of subsystem-wide globals</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Setg_Subsys_List function is the [[ListOfGlobals (System/Subsystem function)]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Setg_Subsys_List function is the <var>[[ListOfGlobals (Subsystem function)|ListOfGlobals]]</var> <var>Subsystem</var> function.</p>


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


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%rc = $Setg_Subsys_List(list_id, sep, subsys_pat, glob_pat)
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Setg_Subsys_List</span>(<span class="term">list_id</span>, [<span class="term">sep</span>], <span class="term">subsys_pat</span>, [<span class="term">glob_pat</span>])
<section end="syntax" /></p>
<p class="caption">$Setg_Subsys_List Function
</p>
</p>
<p class="caption">%RC is set to 0 or to an error indicator.</p>


<p class="code">  
<p>
  0 - No errors
<var class="term">%rc</var> is set to 0 or to an error indicator.</p>
-3 - No room to create $list items
 
        (if LISTFC $SirParm parameter not set)
===Return codes===
-6 - $List identifier invalid
<p class="code"> 0 - No errors
  3 - Subsystem name missing
-3 - No room to create $list items
</p>
    (if LISTFC <var>$SirParm</var> parameter not set)
<p class="caption">$Setg_Subsys_List return codes
-6 - $List identifier invalid
3 - Subsystem name missing
</p>
</p>


This function can be used for debugging, to retrieve values of selected global variables for selected subsystems. The names of subsystems and global variables can be specified using the following wildcard characters:
==Usage notes==
<ul>
<li>This function can be used for debugging, to retrieve values of selected global variables for selected subsystems. The names of subsystems and global variables can be specified using the following wildcard characters:


<table class="syntaxTable">
<table>
<tr><th>*</th>
<tr><th>*</th>
<td>Matches any number of characters including none</td></tr>
<td>Matches any number of characters including none</td></tr>
<tr><th>?</th>
<tr><th>?</th>
<td>Matches any single character</td></tr>
<td>Matches any single character</td></tr>
<tr><th>"</th>
<tr><th>"</th>
<td>Indicates that the next character must be treated literally even if it is a wildcard character.
<td>Indicates that the next character must be treated literally even if it is a wildcard character.
</td></tr></table>
</td></tr></table>


The format of the items created by $Setg_Subsys_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:
<li>The format of the items created by <var>$Setg_Subsys_List</var> is as follows:


<p class="code"> Length Description
<table>
------ -----------------------------------------
<tr class="head"><th>Length</th> <th>Description</th></tr>
10 Subsystem name, padded on right by blanks
<tr><th><var>10</var></th> <td>Subsystem name, padded on right by blanks</td></tr>
gg Global name
<tr><th>gg</th> <td>Global name</td></tr>
ss Separator string
<tr><th>ss</th> <td>Separator string</td></tr>
vv Global value
<tr><th>vv</th> <td>Global value</td></tr>
</p>
</table>
</ul>


For example, the following request displays information about the global variables whose names start with the string 'DATE' in the subsystems whose names contain either the string 'AB' or with the string 'CD'. The display is sorted by subsystem name and global variable name; X'00' as the separator ensures this sort order.
==Example==
<p class="code"> BEGIN
The following request displays information about the global variables whose names start with the string 'DATE' in the subsystems whose names contain either the string 'AB' or with the string 'CD'. The display is sorted by subsystem name and global variable name; X'00' as the separator ensures this sort order.
  %I FLOAT
<p class="code">BEGIN
  %I2 FLOAT
  %I FLOAT
  %L FLOAT
  %I2 FLOAT
  %L2 FLOAT
  %L FLOAT
  %X FLOAT
  %L2 FLOAT
  %SEP STRING LEN 1
  %X FLOAT
  %S1 STRING LEN 255
  %SEP STRING LEN 1
  %L = $ListNew
  %S1 STRING LEN 255
  %SEP = $X2C('00')
  %L = $ListNew
  %X = $Setg_Subsys_List(%L, %SEP, '*AB*')
  %SEP = $X2C('00')
  * Append more globals to $list:
  %X = $Setg_Subsys_List(%L, %SEP, '*AB*')
  %X = $Setg_Subsys_List(%L, %SEP, '*CD*')
  * Append more globals to $list:
  %L2 = $ListSort(%L, '1,10,A 11,255,A')
  %X = $Setg_Subsys_List(%L, %SEP, '*CD*')
  PRINT 'Subsystem Global' AND '/ Value' AT 33
  %L2 = $ListSort(%L, '1,10,A 11,255,A')
  %S1 = '----------'
  PRINT 'Subsystem Global' AND '/ Value' AT 33
  PRINT %S1 AND %S1 WITH %S1 AND ' ' -
  %S1 = '----------'
    AND %S1 WITH %S1
  PRINT %S1 AND %S1 WITH %S1 AND ' ' -
  FOR %X FROM 1 TO $ListCnt(%L2)
    AND %S1 WITH %S1
      %S1 = $ListInf(%L2, %X, 11)
  FOR %X FROM 1 TO $ListCnt(%L2)
      %I = $INDEX(%S1, %SEP)
      %S1 = $ListInf(%L2, %X, 11)
      IF %I EQ 0 THEN
      %I = $INDEX(%S1, %SEP)
          %I = 256
      IF %I EQ 0 THEN
      END IF
        %I = 256
      %I2 = %I
      END IF
      IF %I LT 21 THEN
      %I2 = %I
          %S1 = $PADR($SUBSTR(%S1, 1, %I - 1), ' ', 20)
      IF %I LT 21 THEN
          %I2 = 21
        %S1 = $PADR($SUBSTR(%S1, 1, %I - 1), ' ', 20)
      END IF
        %I2 = 21
      PRINT $ListInf(%L2, %X, 1, 10) AND -
      END IF
            $SUBSTR(%S1, 1, %I2 - 1) AND '/' -
      PRINT $ListInf(%L2, %X, 1, 10) AND -
            AND $ListInf(%L2, %X, 11 + %I)
            $SUBSTR(%S1, 1, %I2 - 1) AND '/' -
    END FOR
            AND $ListInf(%L2, %X, 11 + %I)
END
  END FOR
END
</p>
</p>


 
==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Janus Web Servert]]
<li>[[Janus Web Server]]</li>
</ul>
</ul>
<p class="caption">Products authorizing $Setg_Subsys_List
</p>


[[Category:$Functions|$Setg_Subsys_List]]
[[Category:$Functions|$Setg_Subsys_List]]

Latest revision as of 22:52, 20 September 2018

Get list of subsystem-wide globals

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Setg_Subsys_List function is the ListOfGlobals Subsystem function.

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

The $Setg_Subsys_List function accepts four 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, as shown in the example below.

The third argument specifys the subsystem(s) whose global variables are to be examined for placement on the output $list. This argument may contain pattern matching characters. This is a required argument, and it may not be the null string.

The fourth argument is a pattern string; all global variables in the selected subsystem(s) matching this pattern are placed on the output $list. This is an optional argument; if omitted, all variables in the subsystems specified by the third argument are placed on the output $list.

Syntax

%rc = $Setg_Subsys_List(list_id, [sep], subsys_pat, [glob_pat])

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

Return codes

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

Usage notes

  • This function can be used for debugging, to retrieve values of selected global variables for selected subsystems. The names of subsystems and 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_Subsys_List is as follows:
    Length Description
    10 Subsystem name, padded on right by blanks
    gg Global name
    ss Separator string
    vv Global value

Example

The following request displays information about the global variables whose names start with the string 'DATE' in the subsystems whose names contain either the string 'AB' or with the string 'CD'. The display is sorted by subsystem name and global variable name; X'00' as the separator ensures this sort order.

BEGIN %I FLOAT %I2 FLOAT %L FLOAT %L2 FLOAT %X FLOAT %SEP STRING LEN 1 %S1 STRING LEN 255 %L = $ListNew %SEP = $X2C('00') %X = $Setg_Subsys_List(%L, %SEP, '*AB*') * Append more globals to $list: %X = $Setg_Subsys_List(%L, %SEP, '*CD*') %L2 = $ListSort(%L, '1,10,A 11,255,A') PRINT 'Subsystem Global' AND '/ Value' AT 33 %S1 = '----------' PRINT %S1 AND %S1 WITH %S1 AND ' ' - AND %S1 WITH %S1 FOR %X FROM 1 TO $ListCnt(%L2) %S1 = $ListInf(%L2, %X, 11) %I = $INDEX(%S1, %SEP) IF %I EQ 0 THEN %I = 256 END IF %I2 = %I IF %I LT 21 THEN %S1 = $PADR($SUBSTR(%S1, 1, %I - 1), ' ', 20) %I2 = 21 END IF PRINT $ListInf(%L2, %X, 1, 10) AND - $SUBSTR(%S1, 1, %I2 - 1) AND '/' - AND $ListInf(%L2, %X, 11 + %I) END FOR END

Products authorizing $Setg_Subsys_List