$Lstr Global Set and $Lstr Session Set: Difference between revisions
Jump to navigation
Jump to search
m (→Syntax) |
(Automatically generated page update) |
||
(14 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">$Lstr_Global_Set and $Lstr_Session_Set</span> | <span class="pageSubtitle">$Lstr_Global_Set and $Lstr_Session_Set</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Many $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.</p> | ||
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. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Lstr_Global_Set</span>(<span class="term">gname, value) | <p class="syntax"><span class="term">%rc</span> = <span class="literal">$Lstr_Global_Set</span>(<span class="term">gname</span>, <span class="term">value</span>) | ||
</p> | |||
<p class="syntax">%rc = <span class="literal">$Lstr_Session_Set</span>(<span class="term">gname</span>, <span class="term">value</span>) | |||
</p> | </p> | ||
===Syntax terms=== | ===Syntax terms=== | ||
Line 42: | Line 43: | ||
==Products authorizing $Lstr_Global_Set and $Lstr_Session_Set== | ==Products authorizing $Lstr_Global_Set and $Lstr_Session_Set== | ||
<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_Global_Set and $Lstr_Session_Set]] | [[Category:$Functions|$Lstr_Global_Set and $Lstr_Session_Set]] |
Latest revision as of 22:52, 20 September 2018
$Lstr_Global_Set and $Lstr_Session_Set
Note: Many $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
%rc = $Lstr_Global_Set(gname, value)
%rc = $Lstr_Session_Set(gname, value)
Syntax terms
%rc | A numeric return code that is set to 0 for success, or to -3, if CCATEMP is full and the LISTFC parameter is not set. |
---|---|
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)