$Lstr: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 4: | Line 4: | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Lstr function.</p> | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Lstr function.</p> | ||
This function takes a | This function takes a <var>String</var> or <var>Longstring</var> input and produces a <var>Longstring</var> output. | ||
The <var>$Lstr</var> function accepts one argument and returns a longstring result. | The <var>$Lstr</var> function accepts one argument and returns a longstring result. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" />% | <p class="syntax"><section begin="syntax" />%str = $Lstr(longstring) | ||
<section end="syntax" /></p> | <section end="syntax" /></p> | ||
<p>%str is a copy of <var class="term">longstring</var>.</p> | |||
The first argument is an arbitrary string or longstring. | |||
==Usage notes== | |||
<ul> | |||
<p class="code"> IF %COMEDIANS EQ | <li>The main utility of the <var>$Lstr</var> function is to force a STRING WITH expression that is its argument to be upgraded to a LONGSTRING WITH expression. | ||
For example, | |||
<p class="code">IF %COMEDIANS EQ (%WHO WITH ' Costello') | |||
</p> | </p> | ||
truncates <code>%WHO WITH 'Costello'</code> at 255 bytes before the comparison, even if <code>%COMEDIANS</code> is a LONGSTRING %variable. | |||
However, this statement does not: | |||
<p class="code">IF %COMEDIANS EQ $Lstr(%WHO WITH ' Costello')</p> | |||
</ul> | |||
<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList"> | <h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList"> | ||
Line 41: | Line 37: | ||
<li>[[Japanese functions]]</li> | <li>[[Japanese functions]]</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$Lstr]] | [[Category:$Functions|$Lstr]] |
Revision as of 01:43, 30 October 2012
Treat a string as longstring
Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Lstr function.
This function takes a String or Longstring input and produces a Longstring output.
The $Lstr function accepts one argument and returns a longstring result.
Syntax
<section begin="syntax" />%str = $Lstr(longstring) <section end="syntax" />
%str is a copy of longstring.
The first argument is an arbitrary string or longstring.
Usage notes
- The main utility of the $Lstr function is to force a STRING WITH expression that is its argument to be upgraded to a LONGSTRING WITH expression.
For example,
IF %COMEDIANS EQ (%WHO WITH ' Costello')
truncates
%WHO WITH 'Costello'
at 255 bytes before the comparison, even if%COMEDIANS
is a LONGSTRING %variable. However, this statement does not:IF %COMEDIANS EQ $Lstr(%WHO WITH ' Costello')