$Lstr Left: Difference between revisions
(Automatically generated page update) |
(Automatically generated page update) |
||
Line 51: | Line 51: | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li> | <li>Japanese functions</li> | ||
<li>[http://m204wiki.rocketsoftware.com/images/4/4b/SirfieldNew.pdf Sir2000 Field Migration Facility]</li> | <li>[http://m204wiki.rocketsoftware.com/images/4/4b/SirfieldNew.pdf Sir2000 Field Migration Facility]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$Lstr_Left]] | [[Category:$Functions|$Lstr_Left]] |
Revision as of 16:03, 8 July 2014
Leftmost characters of a longstring
Note: Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_Left function is the Left function.
This function takes a string or longstring input and produces the leftmost characters of the input, possibly padded to an indicated length.
The $Lstr_Left function accepts three arguments and returns a string result.
The first argument is an arbitrary string or longstring. This is a required argument.
The second argument is a number between 1 and 2**31-1 that indicates the result length. This is a required argument.
The third argument is a string containing a single character to be used as the pad character if the result length is longer than the string specified by argument one. This is an optional argument and defaults to a blank.
Syntax
%result = $Lstr_Left(longstring, len, pad)
%result is the leftmost characters of the input longstring, padded with the pad character if necessary.
Usage notes
- $Lstr_Left acts very much like $PADR except
- The target length and pad character arguments are reversed.
- It cancels the request if the result target is too short to hold the result.
- It cancels the request if the pad character argument is longer than one byte.
- It can operate on LONGSTRING inputs.
- It produces a LONGSTRING output.
Examples
- To set %BIG to "Vol":
%BIG = $Lstr_Left('Voldemort', 3)
- To set %BIG to "Snape" followed by 295 exclamation marks:
%BIG = $Lstr_Left('Snape', 300, '!')