ListOfGlobals (System function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
(Automatically generated page update)
 
(One intermediate revision by one other user not shown)
Line 9: Line 9:
<tr><th>%sl</th><td>The <var>[[Stringlist_class|Stringlist]]</var> variable that contains the data about the globals selected according to the pattern given in the <var class="term">string</var> argument.</td></tr>
<tr><th>%sl</th><td>The <var>[[Stringlist_class|Stringlist]]</var> variable that contains the data about the globals selected according to the pattern given in the <var class="term">string</var> argument.</td></tr>


<tr><th><var>%(System)</var></th>
<tr><th><var class="nobr">%(System)</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>[[System_class|System]]</var> object variable, which may be <var>Null</var>.</td></tr>
<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>[[System_class|System]]</var> object variable, which may be <var>Null</var>.</td></tr>


Line 36: Line 36:
<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>
<ul>
<li>Bytes 1-10  Userid that last set the global.
<li>Bytes 1-10  &mdash; Userid that last set the global.
<li>Bytes 12-28  Date and time global last set, in <code>YY/MM/DD HH:MI:SS</code> format.
<li>Bytes 12-28  &mdash; Date and time global last set, in <code>YY/MM/DD HH:MI:SS</code> format.
<li>Bytes 30-53  <var>Null</var> for <var>system</var> globals (<var>Subsystem</var> context for global).
<li>Bytes 30-53  &mdash; <var>Null</var> for <var>system</var> globals (<var>Subsystem</var> context for global).
<li>Bytes 54-    Global name.
<li>Bytes 54-    &mdash; Global name.
</ul>
</ul>



Latest revision as of 00:26, 16 February 2014

List of system globals (System class)

The ListOfGlobals shared function returns a Stringlist containing information about system-wide globals.

Syntax

%sl = %(System):ListOfGlobals[( [string])]

Syntax terms

%slThe Stringlist variable that contains the data about the globals selected according to the pattern given in the string argument.
%(System) The class name in parentheses denotes a shared method. ListOfGlobals can also be invoked via a System object variable, which may be Null.
string 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 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 — Null for system globals (Subsystem context for global).
    • Bytes 54- — Global name.
  • You can map to an image the information in each Stringlist item (described in the previous bullet item) 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 system globals that end in .XML:

%(system):listOfGlobals('*.XML'):print

See also