$Lstr: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 5: Line 5:


This function takes a <var>String</var> or <var>Longstring</var> input and produces a <var>Longstring</var> output.  
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.


==Syntax==
==Syntax==
Line 12: Line 10:
<section end="syntax" /></p>
<section end="syntax" /></p>


<p>%longstr is a copy of <var class="term">longstring</var>.</p>
<p>
<var class="term">%longstr</var> is a copy of <var class="term">longstring</var>.</p>


The argument is an arbitrary string or longstring.
The <var class="term">longstring</var> argument is an arbitrary string or longstring.


==Usage notes==
==Usage notes==

Revision as of 15:21, 5 November 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.

Syntax

<section begin="syntax" />%longstr = $Lstr(longstring) <section end="syntax" />

%longstr is a copy of longstring.

The longstring 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')


Products authorizing $Lstr