Print (Stringlist function)

From m204wiki
Revision as of 14:16, 24 November 2010 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Display contents of a Stringlist

This callable method displays the contents of a Stringlist on the user's standard output device, typically a terminal.

Print is a member of the Stringlist class.

Print Syntax

[%rc =] %sl:Print( [[NumWidth=] itemnumlen] -
                   [, [LenWidth=] itemlen] -
                   [, [Start=] firstitem] -
                   [, [MaxItems=] maxitems])

Syntax Terms

%rc
A numeric variable that is set to the number of Stringlist items displayed.
%sl
A Stringlist object.
NumWidth=itemnumlen
The number of bytes in the display of each line to use for the item number. The parameter name .NumWidth is optional. The length must be a number between 0 and 10 inclusive; if it is greater than 0, a blank is placed after the item number. Item numbers are right-justified within the indicated number of bytes, and they are truncated on the left if the length of the item number exceeds the space allocated for it. This is an optional argument; it defaults to zero, which means the item numbers are not displayed.
LenWidth=itemlen
The number of bytes in the display of each line to use for the item length. The parameter name .LenWidth is optional. The length must be a number between 0 and 4 inclusive; if it is greater than 0, a blank is placed after the item length. Item lengths are right-justified within the indicated number of bytes, and they are truncated on the left if the length of the item length exceeds the space allocated for it. This is an optional argument; it defaults to zero, which means the item lengths are not displayed.
Start=firstitem
Alternatively named .Start, this is the number of the initial item to display. This is an optional argument, and it defaults to 1.
MaxItems=maxitems
Alternatively named .MaxItems, this is the maximum number of items to display. A zero or negative value means to display all the Stringlist items. This is an optional argument; it defaults to zero, which means display to the end of the Stringlist.

Usage Notes

  • The parameter names were introduced in Sirius Mods Version 7.0; for versions prior to that, the parameters can only be specified positionally. For example, to display the contents of a Stringlist with 6 bytes to be used for the column containing the item width, and limiting the display to 20 items, you can use positional parameters:
    %listrint(,6,,20)
    

    Under Sirius Mods 7.0 and later, you can do the same thing with named parameters:

    %listrint(lenWidth=6, maxItems=20)
    
  • All errors in Print result in request cancellation.