ListOfStrings (System function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (Line up nicer)
 
(17 intermediate revisions by 5 users not shown)
Line 4: Line 4:
==Syntax==
==Syntax==
{{Template:System:ListOfStrings syntax}}
{{Template:System:ListOfStrings syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%sl</th><td>The <var>Stringlist</var> variable that contains the data about the global strings selected according to the <var class="term">nameW</var> pattern.</td></tr>
<tr><th>%sl</th>
<tr><th><var>%(System)</var></th>
<td>The <var>Stringlist</var> variable that contains the data about the global strings selected according to the pattern in <var class="term">string</var>.</td></tr>
<td>The class name in parentheses denotes a shared method. <var>ListOfStrings</var> can also be invoked via a <var>System</var> object variable, which may be <var>null</var>.</td></tr>
 
<tr><th>nameW</th>
<tr><th><var class="nobr">%(System)</var></th>
<td>An optional identifying string which may include wildcard characters.  Descriptions of the global strings whose names match the <var class="term">nameW</var> pattern are returned to the <var class="term">%sl</var> <var>Stringlist</var>.
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>ListOfStrings</var> can also be invoked via a <var>System</var> object variable, which may be <var>null</var>.</td></tr>
<p>This argument defaults to an asterisk (<code>*</code>), that is, all global strings, and its eligible wildcard characters are shown below:</p>
 
<ul><li><code>*</code> Matches any group of 0 or more characters
<tr><th>string</th>
<li><code>?</code> Matches any single character
<td>An optional identifying string which may include wildcard characters.  Descriptions of the global strings whose names match the <var class="term">string</var> pattern are returned to the <var class="term">%sl</var> <var>Stringlist</var>.
<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>
<p>
This argument defaults to an asterisk (<tt>*</tt>), that is, all global strings, and its eligible wildcard characters are shown below:</p>
<table>
<tr><th>*</th>
<td>Matches any group of 0 or more characters</td></tr>
 
<tr><th>?</th>
<td>Matches any single character</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 items placed on the target <var>Stringlist</var> are put there in no particular order.
<li>The items placed on the target <var>Stringlist</var> are put there in no particular order.
<li>The data returned to the <var>Stringlist</var> is in character format with the following contents:
<li>The data returned to the <var>Stringlist</var> is in character format with the following contents:
<ul><li>Bytes 1-10 Userid that last set the global.
<ul>
<li>Bytes 12-28 Date and time global last set, in YY/MM/DD HH:MI:SS format.
<li>Bytes 1-10 &mdash; Userid that last set the global.
<li>Bytes 30-53 Subsystem context for global. Null for system strings.
<li>Bytes 12-28 &mdash; Date and time global last set, in YY/MM/DD HH:MI:SS format.
<li>Bytes 54- Global name.
<li>Bytes 30-53 &mdash; Subsystem context for global. Null for system strings.
<li>Bytes 54-&nbsp; &mdash; Global name.
</ul>
</ul>
<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
   userid is string len 11
   userid     is string len 11
   dateTime is string len 18
   dateTime   is string len 18
   subsystem is string len 24
   subsystem is string len 24
   name is string len 255
   name       is string len 255
end image
end image
</p>
</p>
Line 39: Line 56:


%sl = %(subsystem):listOfStrings
%sl = %(subsystem):listOfStrings
prepare image desc
identify image desc
%sl:bindImage('DESC')
%sl:[[BindImage (Stringlist subroutine)|bindImage]]('DESC')


for %i from 1 to %sl:count
for %i from 1 to %sl:count
   %sl:getImage(%i)
  prepare image desc
   %sl:[[GetImage (Stringlist subroutine)|getImage]](%i)
   print %desc:userid and %desc:dateTime and -
   print %desc:userid and %desc:dateTime and -
         %desc:subsystem and %desc:name
         %desc:subsystem and %desc:name
Line 50: Line 68:


==Examples==
==Examples==
<ol><li>The following statement prints the description of all system strings that end in <code>XML</code>:
The following statement prints the description of all system strings that end in <code>XML</code>:
<p class="code">%(system):listOfStrings('*.XML'):print</p>
<p class="code">%(system):listOfStrings('*.XML'):print</p>
</ol>


==See also==
==See also==
{{Template:System:ListOfStrings footer}}
{{Template:System:ListOfStrings footer}}

Latest revision as of 22:15, 22 October 2015

List of system strings (System class)

The ListOfStrings shared function returns a Stringlist containing information about system-wide strings.

Syntax

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

Syntax terms

%sl The Stringlist variable that contains the data about the global strings selected according to the pattern in string.
%(System) The class name in parentheses denotes a shared method. ListOfStrings can also be invoked via a System object variable, which may be null.
string An optional identifying string which may include wildcard characters. Descriptions of the global strings whose names match the string pattern are returned to the %sl Stringlist.

This argument defaults to an asterisk (*), that is, all global strings, and its eligible wildcard characters are shown below:

* Matches any group of 0 or more characters
? Matches any single character
" 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 Stringlist are put there in no particular order.
  • The data returned to 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 strings.
    • 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 = %(subsystem):listOfStrings identify image desc %sl:bindImage('DESC') for %i from 1 to %sl:count prepare image desc %sl:getImage(%i) print %desc:userid and %desc:dateTime and - %desc:subsystem and %desc:name end for

Examples

The following statement prints the description of all system strings that end in XML:

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

See also