ListOfStrings (System function)

From m204wiki
Revision as of 22:06, 14 August 2014 by Dme (talk | contribs) (→‎Usage notes)
Jump to navigation Jump to search

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