$Lstr Global Get and $Lstr Session Get: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />and $Lstr_Session_Get<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />and $Lstr_Session_Get<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. | <p class="warning">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.</p> | ||
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. | 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. | ||
Line 9: | Line 9: | ||
The first argument is a string containing the name of the global or session longstring. This is a required argument. | 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) | ||
Line 21: | Line 22: | ||
</p> | </p> | ||
<p class="caption">%LSTR is set to the value of the session longstring.</p> | <p class="caption">%LSTR is set to the value of the session longstring.</p> | ||
$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 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. | ||
In the following example, the value of the global longstring named "POLLY&CQ. is retrieved into the longstring %PARROT. | In the following example, the value of the global longstring named "POLLY&CQ. is retrieved into the longstring %PARROT. | ||
<p class="code"> %PARROT = $Lstr_Global_Get('POLLY') | <p class="code"> %PARROT = $Lstr_Global_Get('POLLY') | ||
</p> | </p> | ||
$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. For more information about sessions see :hdref refid=ses.. | $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. For more information about sessions see :hdref refid=ses.. |
Revision as of 21:37, 10 February 2011
<section begin="desc" />and $Lstr_Session_Get<section end="desc" />
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.
$Lstr_Global_Get and $Lstr_Session_Get 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
<section begin="syntax" /> %LSTR = $Lstr_Global_Get(gname) <section end="syntax" />
%LSTR = $Lstr_Session_Get(gname)
$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. In the following example, the value of the global longstring named "POLLY&CQ. is retrieved into the longstring %PARROT.
%PARROT = $Lstr_Global_Get('POLLY')
$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. For more information about sessions see :hdref refid=ses..
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.
$Lstr_Global_Get and $Lstr_Session_Get are new in Version 6.3 of the Sirius Mods.