ListOfGlobals (Subsystem function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (syntax terms)
 
(19 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:Subsystem:ListOfGlobals subtitle}}
{{Template:Subsystem:ListOfGlobals subtitle}}
The <var>ListOfGlobals</var> shared function returns a <var>[[Stringlist_class|Stringlist]]</var> containing information about <var>[[Subsystem_class|Subsystem]]</var> globals.
The <var>ListOfGlobals</var> shared function returns a <var>[[Stringlist_class|Stringlist]]</var> containing information about [[Subsystem_class#System_and_subsystem_globals_and_strings|subsystem globals]].


==Syntax==
==Syntax==
{{Template:Subsystem:ListOfGlobals syntax}}
{{Template:Subsystem:ListOfGlobals syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%sl</th><td>The <var>[[Stringlist_class|Stringlist]]</var> variable that contains the data about the globals selected according to the name pattern(s).</td></tr>
<tr><th>%sl</th><td>The <var>Stringlist</var> variable that contains the data about the globals selected according to the <var class="term">nameW</var> and <var class="term">subsysW</var> patterns.</td></tr>
<tr><th>%(Subsystem)</th>
 
<td>The class name in parentheses denotes a shared method. <var>ListOfGlobals</var> can also be invoked via a <var>[[Subsystem_class|Subsystem]]</var> object variable, which may be null.</td></tr>
<tr><th><var class="nobr">%(Subsystem)</var></th>
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>ListOfGlobals</var> can also be invoked via a <var>Subsystem</var> object variable, which may be <var>null</var>.</td></tr>
 
<tr><th>subsysW</th>
<td>The subsystem context for which globals are to be listed. This can be a specific name or a name containing wildcards. This is an optional argument which defaults to an asterisk (<code>*</code>), that is, all subsystems. The eligible wildcard characters are the same as those for <var class="term">nameW</var>, above.</td></tr>
 
<tr><th>nameW</th>
<tr><th>nameW</th>
<td>A string that identifies the name of the global(s) to be listed. This can be a specific name or a name containing wildcards. This optional argument defaults to an asterisk (<code>*</code>), that is, all globals.
<td>A string that identifies the name of the global(s) to be listed. This can be a specific name or a name containing wildcards. This optional argument defaults to an asterisk (<tt>*</tt>), that is, all globals.
<p>The eligible wildcard characters are:</p>
<p>
<ul><li><code>*</code> Matches any group of 0 or more characters
The eligible wildcard characters are:</p>
<li><code>?</code> Matches any single characters
<table class="noVar">
<li><code>"</code> An escape, which means the next character is treated literally, even if it is a double quotation mark (<code>"</code>), question mark (<code>?</code>), or asterisk (<code>*</code>).</ul></td></tr>
<tr><th>*</th>
<tr><th>subsysW</th>
<td>Matches any group of 0 or more characters</td></tr>
<td>The <var>subsystem</var> context for which globals are to be listed. This can be a specific name or a name containing wildcards. This is an optional argument which defaults to an asterisk (<code>*</code>), that is, all <var>subsystems</var>. The eligible wildcard characters are the same as those for <var class="term">nameW</var>, above.</td></tr>
 
<tr><th>?</th>
<td>Matches any single characters</td></tr>
 
<tr><th>"</th>
<td>An escape, which means the next character is treated literally, even if it is a double quotation mark (<tt>"</tt>), question mark (<tt>?</tt>), or asterisk (<tt>*</tt>).</td></tr>
</table></td></tr>
</table>
</table>


==Usage notes==
==Usage notes==
<ul><li>All errors result in request cancellation.
<ul>
<li>All errors result in request cancellation.
 
<li>The <var>Subsystem</var> class <var>ListOfGlobals</var> applies to the subsys argument only; it ignores the current subsystem context.
<li>The <var>Subsystem</var> class <var>ListOfGlobals</var> applies to the subsys argument only; it ignores the current subsystem context.
<li>The items placed on the target <var class="term">sl</var> are put there in no particular order.
<li>The items placed on the target <var class="term">sl</var> are put there in no particular order.
<li>The data returned to each item of the <var>Stringlist</var> is in character format with the following contents:
<li>The data returned to each item of the <var>Stringlist</var> is in character format with the following contents:
<ul><li>Bytes 1-10  Userid that last set the global.
<dl>
<li>Bytes 12-28  Date and time global last set, in YY/MM/DD HH:MI:SS format.
<dt>Bytes 1-10  <dd>Userid that last set the global.
<li>Bytes 30-53  <Var>Subsystem</var> context for global (<var>Null</var> for <var>system</var> globals).
<dt>Bytes 12-28  <dd>Date and time global last set, in <code>YY/MM/DD HH:MI:SS</code> format.
<li>Bytes 54-    Global name.
<dt>Bytes 30-53  <dd><Var>Subsystem</var> context for global (<var>Null</var> for <var>system</var> globals).
</ul>
<dt>Bytes 54-    <dd>Global name.
</dl>
 
<li>You can map to an image the information in each <var>Stringlist</var> item (described in the previous bullet) as follows
<li>You can map to an image the information in each <var>Stringlist</var> item (described in the previous bullet) as follows
<p class="code">image desc
<p class="code">image desc
Line 53: Line 71:


==Examples==
==Examples==
<ol><li>The following statement prints the description of all <var>subsystem</var> globals:
The following statement prints the description of all <var>subsystem</var> globals:
<p class="code">%(subsystem):listOfGlobals:print
<p class="code">%(subsystem):listOfGlobals:print
</p>
</p>
</ol>
 
==See also==
==See also==
{{Template:Subsystem:ListOfGlobals footer}}
{{Template:Subsystem:ListOfGlobals footer}}

Latest revision as of 12:56, 14 May 2016

List of subsystem globals (Subsystem class)

The ListOfGlobals shared function returns a Stringlist containing information about subsystem globals.

Syntax

%sl = %(Subsystem):ListOfGlobals[( [subsysW], [nameW])]

Syntax terms

%slThe Stringlist variable that contains the data about the globals selected according to the nameW and subsysW patterns.
%(Subsystem) The class name in parentheses denotes a shared method. ListOfGlobals can also be invoked via a Subsystem object variable, which may be null.
subsysW The subsystem context for which globals are to be listed. This can be a specific name or a name containing wildcards. This is an optional argument which defaults to an asterisk (*), that is, all subsystems. The eligible wildcard characters are the same as those for nameW, above.
nameW A string that identifies the name of the global(s) to be listed. This can be a specific name or a name containing wildcards. This optional argument defaults to an asterisk (*), that is, all globals.

The eligible wildcard characters are:

* Matches any group of 0 or more characters
? Matches any single characters
" An escape, which means the next character is treated literally, even if it is a double quotation mark ("), question mark (?), or asterisk (*).

Usage notes

  • All errors result in request cancellation.
  • The Subsystem class ListOfGlobals applies to the subsys argument only; it ignores the current subsystem context.
  • The items placed on the target sl are put there in no particular order.
  • The data returned to each item of the Stringlist is in character format with the following contents:
    Bytes 1-10
    Userid that last set the global.
    Bytes 12-28
    Date and time global last set, in YY/MM/DD HH:MI:SS format.
    Bytes 30-53
    Subsystem context for global (Null for system globals).
    Bytes 54-
    Global name.
  • You can map to an image the information in each Stringlist item (described in the previous bullet) as follows

    image desc userid is string len 11 dateTime is string len 18 subsystem is string len 24 name is string len 255 end image

    Note that the image items are one byte longer than the item lengths indicated in the previous bullet. Those bytes would be blank, so standard trailing-blank stripping for image items will cause that extra blank to be stripped. The above image could then be used to map the entries, as follows:

    %sl is object stringList %i is float %sl = %(system):listOfGlobals prepare image desc %sl:bindImage('DESC') for %i from 1 to %sl:count %sl:getImage(%i) print %desc:userid and %desc:dateTime and %desc:name end for

Examples

The following statement prints the description of all subsystem globals:

%(subsystem):listOfGlobals:print

See also