MAINSAIL Language Manual, Section 46.14

previous   next   top   contents   index   framed top   this page unframed


46.14. $removeBits

Figure 46–18. $removeBits
STRING
PROCEDURE   $removeBits (MODIFIES STRING s;
                         
OPTIONAL BITS ctrlBits);

$removeBits reads a BITS representation from the beginning of s. $removeBits returns the null STRING if s does not begin with a valid STRING representation of a BITS value; otherwise, it removes the longest prefix of s that represents a valid BITS STRING (as if the PROCEDURE read had been called to read a BITS value from s).

The valid ctrlBits bits are discard, formatted, binary, octal, and hex. If discard is set, initial blank, tab, end-of-page, carriage return, and linefeed characters are removed from s before looking for the BITS value. If formatted is set, the null STRING is returned if the BITS value in s does not begin with the single quote (') character. If binary, octal, or hex is set, a STRING representing a value in the corresponding radix is removed unless overridden by an initial 'B, 'O, or 'H. If none of binary, octal, or hex is specified in ctrlBits, $removeBits removes a value of the system-dependent radix $preferredRadix, unless overridden by an initial 'B, 'O, or 'H.

If s does not begin with a valid BITS STRING representation (following whitespace characters if discard is set), s is not altered.


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 46.14