$Lstr Global Get and $Lstr Session Get: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 5: Line 5:


This function retrieves the value of a global or [[Sessions|session]] longstring. If the global or session longstring has never been set it returns a null.  
This function retrieves the value of a global or [[Sessions|session]] longstring. If the global or session longstring has never been set it returns a null.  
<var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> accept one argument and returns a string result.
The first argument is a string containing the name of the global or session longstring. This is a required argument.


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%lstr = $Lstr_Global_Get(gname)
<p class="syntax"><section begin="syntax" />%lstr = $Lstr_Global_Get(gname)
<section end="syntax" /></p>
<section end="syntax" /></p>
<p class="caption">$Lstr_Global_Get Function
<p class="code">%lstr = $Lstr_Session_Get(gname)</p>
</p>
<p class="caption">%LSTR is set to the value of the global longstring.</p>
<p class="code">  
%LSTR = $Lstr_Session_Get(gname)
</p>
<p class="caption">$Lstr_Session_Get Function
</p>
<p class="caption">%LSTR is set to the value of the session longstring.</p>


<var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> are roughly analogous to the $GETG function for longstrings. <var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> will return the current value of a global or session longstring whether or not that longstring is bound in the current request via <var>$Lstr_Global</var> or $Lstr_Session. However, if a global or session longstring value is to be retrieved and updated frequently in a request it is generally better to bind that longstring to a %variable using <var>$Lstr_Global</var> or $Lstr_Session.
===Syntax terms===
In the following example, the value of the global longstring named "POLLY&amp;CQ. is retrieved into the longstring %PARROT.
<table class="syntaxTable">
<tr><th>%lstr</th>
<td>A longstring set to the value of the global or session longstring.</td></tr>


<p class="code"> %PARROT = $Lstr_Global_Get('POLLY')
<tr><th>gname</th>
</p>
<td>A string containing the name of the global or session longstring. This is a required argument.</td></tr>
</table>


<var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> have independent namespaces. That is, the same name used for <var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> reference different longstrings. A <var>$Lstr_Session_Get</var> call when there is no session open causes a request cancellation.  
==Usage notes==
<ul>
<li><var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> are roughly analogous to the $GETG function for longstrings. <var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> will return the current value of a global or session longstring whether or not that longstring is bound in the current request via <var>$Lstr_Global</var> or $Lstr_Session. However, if a global or session longstring value is to be retrieved and updated frequently in a request it is generally better to bind that longstring to a %variable using <var>$Lstr_Global</var> or $Lstr_Session.


While the <var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> are longstring capable the global names themselves cannot be longer than 255 bytes. An attempt to use a longer name results in a request cancellation truncation error.  
<li><var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> have independent namespaces. That is, the same name used for <var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> reference different longstrings. A <var>$Lstr_Session_Get</var> call when there is no session open causes a request cancellation.  


You can clean up any global longstrings with <var>$Lstr_Global_Del</var> and any session longstrings with $Lstr_Session_Del.  
<li>While the <var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> are longstring capable the global names themselves cannot be longer than 255 bytes. An attempt to use a longer name results in a request cancellation truncation error.  


<var>$Lstr_Global_Get</var> and <var>$Lstr_Session_Get</var> are new in Version 6.3 of the <var class="product">[[Sirius Mods]]</var>.<p>
<li>You can clean up any global longstrings with <var>$Lstr_Global_Del</var> and any session longstrings with $Lstr_Session_Del.
</ul>
 
==Example==
In the following example, the value of the global longstring named <code>POLLY</code> is retrieved into the longstring <code>%PARROT</code>.
<p class="code">%PARROT = $Lstr_Global_Get('POLLY')
</p>


<h2>Products authorizing $Lstr_Global_Get and $Lstr_Session_Get</h2>
<h2>Products authorizing $Lstr_Global_Get and $Lstr_Session_Get</h2>
Line 47: Line 46:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
   
   
</p>
<p>
</p>


[[Category:$Functions|$Lstr_Global_Get and $Lstr_Session_Get]]
[[Category:$Functions|$Lstr_Global_Get and $Lstr_Session_Get]]

Revision as of 00:12, 26 October 2012

$Lstr_Global_Get and $Lstr_Session_Get

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There are no OO equivalent for the $Lstr_Global_Get and $Lstr_Session_Get functions.

This function retrieves the value of a global or session longstring. If the global or session longstring has never been set it returns a null.

Syntax

<section begin="syntax" />%lstr = $Lstr_Global_Get(gname) <section end="syntax" />

%lstr = $Lstr_Session_Get(gname)

Syntax terms

%lstr A longstring set to the value of the global or session longstring.
gname A string containing the name of the global or session longstring. This is a required argument.

Usage notes

  • $Lstr_Global_Get and $Lstr_Session_Get are roughly analogous to the $GETG function for longstrings. $Lstr_Global_Get and $Lstr_Session_Get will return the current value of a global or session longstring whether or not that longstring is bound in the current request via $Lstr_Global or $Lstr_Session. However, if a global or session longstring value is to be retrieved and updated frequently in a request it is generally better to bind that longstring to a %variable using $Lstr_Global or $Lstr_Session.
  • $Lstr_Global_Get and $Lstr_Session_Get have independent namespaces. That is, the same name used for $Lstr_Global_Get and $Lstr_Session_Get reference different longstrings. A $Lstr_Session_Get call when there is no session open causes a request cancellation.
  • While the $Lstr_Global_Get and $Lstr_Session_Get are longstring capable the global names themselves cannot be longer than 255 bytes. An attempt to use a longer name results in a request cancellation truncation error.
  • You can clean up any global longstrings with $Lstr_Global_Del and any session longstrings with $Lstr_Session_Del.

Example

In the following example, the value of the global longstring named POLLY is retrieved into the longstring %PARROT.

%PARROT = $Lstr_Global_Get('POLLY')

Products authorizing $Lstr_Global_Get and $Lstr_Session_Get