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

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 6: Line 6:
This function sets the value of a global or session longstring. If the global or session longstring has never been set or bound to a %variable it is created.  
This function sets the value of a global or session longstring. If the global or session longstring has never been set or bound to a %variable it is created.  


<var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> accept two arguments and returns a 0 for success or a -3 if CCATEMP is full and the LISTFC parameter is not set.
==Syntax==
<p class="syntax"><section begin="syntax" />%rc = $Lstr_Global_Set(gname, value)
<section end="syntax" /></p>
<p class="code">%rc = $Lstr_Session_Set(gname, value)</p>


The first argument is a string containing the name of the global or session longstring. This is a required argument.  
===Syntax terms===
<table class="syntaxTable">
<tr><th>%rc</th>
<td>A numeric return code that is set to 0 for success or, if CCATEMP is full and the LISTFC parameter is not set, to -3.</td></tr>


The second argument is a longstring containing the value to which to set the global or session longstring. This is a required argument.
<tr><th>gname</th>
<td>A string containing the name of the global or session longstring. This is a required argument. </td></tr>


==Syntax==
<tr><th>value</th>
<p class="syntax"><section begin="syntax" />%rc = $Lstr_Global_Set(gname, value)
<td>A longstring containing the value to which to set the global or session longstring. This is a required argument.</td></tr>
<section end="syntax" /></p>
</table>
<p class="caption">$Lstr_Global_Set Function
 
</p>
==Usage notes==
<p class="caption">%RC is set to 0 or, if CCATEMP is full, to -3.</p>
<ul>
<p class="code">  
<li><var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> are roughly analogous to the <var>$Setg</var> function for longstrings. <var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> will set the current value of a global or [[Sessions|session]] longstring whether or not that longstring is bound in the current request via <var>$Lstr_Global</var> or <var>$Lstr_Session</var>. A longstring %variable bound to the global or session longstring set by these functions immediately reflects the new value of the global or session longstring. 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 <var>$Lstr_Session</var>.
%RC = $Lstr_Session_Set(gname, value)
</p>
<p class="caption">$Lstr_Session_Set Function
</p>
<p class="caption">%RC is set to 0 or, if CCATEMP is full, to -3.</p>


<var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> are roughly analogous to the $SETG function for longstrings. <var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> will set the current value of a global or [[Sessions|session]] longstring whether or not that longstring is bound in the current request via <var>$Lstr_Global</var> or $Lstr_Session. A longstring %variable bound to the global or session longstring set by these functions immediately reflects the new value of the global or session longstring. 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.
<li><var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> have independent namespaces. That is, the same name used for <var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> reference different longstrings. A <var>$Lstr_Session_Set</var> call when there is no session open causes a request cancellation.  
In the following example, the value of the global longstring named "POLLY" is set to the value in longstring %CRACKER.


<p class="code"> %RC = $Lstr_Global_Set('POLLY', %CRACKER)
<li>While the <var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</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.
</p>


<var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> have independent namespaces. That is, the same name used for <var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> reference different longstrings. A <var>$Lstr_Session_Set</var> call when there is no session open causes a request cancellation.
<li>You can clean up any global longstrings with <var>$Lstr_Global_Del</var> and any session longstrings with $Lstr_Session_Del.  
</ul>


While the <var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</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.  
==Example==
In the following example, the value of the global longstring named <code>POLLY</code> is set to the value in longstring <code>%CRACKER</code>.


You can clean up any global longstrings with <var>$Lstr_Global_Del</var> and any session longstrings with $Lstr_Session_Del.
<p class="code">%rc = $Lstr_Global_Set('POLLY', %CRACKER)
</p>


<var>$Lstr_Global_Set</var> and <var>$Lstr_Session_Set</var> are new in Version 6.3 of the <var class="product">[[Sirius Mods]]</var>.<p>


<h2>Products authorizing $Lstr_Global_Set and $Lstr_Session_Set</h2>
<h2>Products authorizing $Lstr_Global_Set and $Lstr_Session_Set</h2>
Line 49: Line 51:
<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_Set and $Lstr_Session_Set]]
[[Category:$Functions|$Lstr_Global_Set and $Lstr_Session_Set]]

Revision as of 00:10, 26 October 2012

$Lstr_Global_Set and $Lstr_Session_Set

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There are not OO equivalent for the $Lstr_Global_Set and $Lstr_Session_Set functions.

This function sets the value of a global or session longstring. If the global or session longstring has never been set or bound to a %variable it is created.

Syntax

<section begin="syntax" />%rc = $Lstr_Global_Set(gname, value) <section end="syntax" />

%rc = $Lstr_Session_Set(gname, value)

Syntax terms

%rc A numeric return code that is set to 0 for success or, if CCATEMP is full and the LISTFC parameter is not set, to -3.
gname A string containing the name of the global or session longstring. This is a required argument.
value A longstring containing the value to which to set the global or session longstring. This is a required argument.

Usage notes

  • $Lstr_Global_Set and $Lstr_Session_Set are roughly analogous to the $Setg function for longstrings. $Lstr_Global_Set and $Lstr_Session_Set will set 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. A longstring %variable bound to the global or session longstring set by these functions immediately reflects the new value of the global or session longstring. 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_Set and $Lstr_Session_Set have independent namespaces. That is, the same name used for $Lstr_Global_Set and $Lstr_Session_Set reference different longstrings. A $Lstr_Session_Set call when there is no session open causes a request cancellation.
  • While the $Lstr_Global_Set and $Lstr_Session_Set 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 set to the value in longstring %CRACKER.

%rc = $Lstr_Global_Set('POLLY', %CRACKER)


Products authorizing $Lstr_Global_Set and $Lstr_Session_Set