$Lstr Right: Difference between revisions
m (1 revision) |
(Automatically generated page update) |
||
(39 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Rightmost characters of a longstring</span> | <span class="pageSubtitle">Rightmost characters of a longstring</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_Right function is the <var>[[Right (String function)|Right]]</var> function.</p> | ||
This function takes a string or longstring input and produces the rightmost characters of the input, possibly padded to an indicated length. | This function takes a string or longstring input and produces the rightmost characters of the input, possibly padded to an indicated length. | ||
The $Lstr_Right function accepts three arguments and returns a string result. | The <var>$Lstr_Right</var> function accepts three arguments and returns a string result. | ||
The first argument is an arbitrary string or longstring. This is a required argument. | The first argument is an arbitrary string or longstring. This is a required argument. | ||
Line 15: | Line 15: | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%result</span> = $Lstr_Right(longstring, len, pad) | ||
</p> | </p> | ||
<var>$Lstr_Right</var> acts very much like $PAD except | <p><var class="term">%result</var> is the rightmost characters of the input longstring, padded with the pad character if necessary.</p> | ||
==Usage notes== | |||
<ul> | |||
<li><var>$Lstr_Right</var> acts very much like $PAD except: | |||
<ul> | <ul> | ||
Line 29: | Line 30: | ||
<li>It can operate on LONGSTRING inputs. | <li>It can operate on LONGSTRING inputs. | ||
<li>It produces a LONGSTRING output. | <li>It produces a LONGSTRING output. | ||
</ul> | |||
</ul> | </ul> | ||
==Examples== | |||
<p class="code"> %BIG = $Lstr_Right('McGonagall', 3) | <ol> | ||
<li>To set %BIG to <code>all</code>: | |||
<p class="code">%BIG = $Lstr_Right('McGonagall', 3) | |||
</p> | </p> | ||
<li>To set %BIG to 290 question marks followed by <code>Dumbledore</code>: | |||
<p class="code">%BIG = $Lstr_Right('Dumbledore', 300, '?') | |||
<p class="code"> %BIG = $Lstr_Right('Dumbledore', 300, '?') | |||
</p> | </p> | ||
</ol> | |||
==Products authorizing {{PAGENAMEE}}== | |||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
<li>[[Sirius functions]]</li> | <li>[[List of $functions|Sirius functions]]</li> | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[[Janus Open Client]]</li> | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[[Janus Open Server]]</li> | <li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li> | <li>Japanese functions</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$Lstr_Right]] | [[Category:$Functions|$Lstr_Right]] |
Latest revision as of 22:52, 20 September 2018
Rightmost characters of a longstring
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Lstr_Right function is the Right function.
This function takes a string or longstring input and produces the rightmost characters of the input, possibly padded to an indicated length.
The $Lstr_Right 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_Right(longstring, len, pad)
%result is the rightmost characters of the input longstring, padded with the pad character if necessary.
Usage notes
- $Lstr_Right acts very much like $PAD 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
all
:%BIG = $Lstr_Right('McGonagall', 3)
- To set %BIG to 290 question marks followed by
Dumbledore
:%BIG = $Lstr_Right('Dumbledore', 300, '?')