$Lstr Global and $Lstr Session: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 4: Line 4:
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no direct OO equivalent for the $Lstr_Global and $Lstr_Session functions because setting Longstrings as session or global variables can be accomplished on the declarations.</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no direct OO equivalent for the $Lstr_Global and $Lstr_Session functions because setting Longstrings as session or global variables can be accomplished on the declarations.</p>


This function binds a longstring %variable to a global or session longstring. That is, the longstring %variable assumes the value of the global or session longstring and any changes to the longstring %variable are reflected in the global or session longstring. The global or session longstring could be one that already existed because of a previous [[$Lstr_Global]], [[$Lstr_Session]], [[$Lstr_Global_Set]] or [[$Lstr_Session_Set]] call.
This function binds a longstring %variable to a global or session longstring. That is, the longstring %variable assumes the value of the global or session longstring and any changes to the longstring %variable are reflected in the global or session longstring. The global or session longstring could be one that already existed because of a previous <var>$Lstr_Global</var>, <var>$Lstr_Session</var>, <var>[[$Lstr_Global_Get and $Lstr_Session_Get|$Lstr_Global_Set]]</var>, or <var>[[$Lstr_Global_Get and $Lstr_Session_Get|$Lstr_Session_Set]]</var> call.  
 
<var>$Lstr_Global</var> and <var>$Lstr_Session</var> accept three arguments and return a numeric result.


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%rc = $Lstr_Global(gname, lstr, options)
<p class="syntax"><section begin="syntax" />%rc = $Lstr_Global(gname, lstr, options)
<section end="syntax" /></p>
<section end="syntax" /></p>
<p class="caption">$Lstr_Global Function
</p>
<p class="caption">%RC is set to 0 or, if CCATEMP is full, to -3.</p>


<p class="code">  
<p class="code">  
%RC = $Lstr_Session(gname, lstr, options)
%rc = $Lstr_Session(gname, lstr, options)</p>
</p>
 
<p class="caption">$Lstr_Session Function
===Syntax terms===
</p>
<table class="syntaxTable">
<p class="caption">%RC is set to 0 or, if CCATEMP is full, to -3.</p>
<tr><th>%rc</th>
<td>A numeric return code that is set to 0 or, if CCATEMP is full, to -3.</td></tr>
 
<tr><th>gname</th>
<td>The name of the global or session longstring. This is an optional argument and, if not specified, the longstring %variable is unbound from whatever global or session longstring it's bound to, if any, and then set to null. </td></tr>
 
<tr><th>lstr</th>
<td>A longstring %variable. It cannot be a complex subroutine parameter. This is a required argument. </td></tr>


<ul>
<tr><th>options</th>
<li>The first argument is the name of the global or session longstring. This is an optional argument and, if not specified, the longstring %variable is unbound from whatever global or session longstring it's bound to, if any, and then set to null.
<td>The type of processing <var>$Lstr_Global</var> or <var>$Lstr_Session</var> is to perform. Valid values of this optional argument are listed below; the default is <var>ANY</var>:
<li>The second argument is a longstring %variable. It cannot be a complex subroutine parameter. This is a required argument.
<li>The third argument indicates the type of processing <var>$Lstr_Global</var> or <var>$Lstr_Session</var> is to perform. Valid values of this optional argument are listed below; the default is ANY.
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>ANY</th>
<tr><th><var>ANY</var></th>
<td>If the global or session longstring already exists, it is referenced with its current contents. If it does not exists, a new null global or session longstring is created.</td></tr>
<td>If the global or session longstring already exists, it is referenced with its current contents. If it does not exists, a new null global or session longstring is created.</td></tr>
<tr><th>OLD</th>
 
<td>The global or session longstring must already exist, that is, it must have been created with a previous $LSTR_GLOBAL, $LSTR_SESSION, $LSTR_GLOBAL_SET, or <var>$Lstr_Session_Set</var> call.</td></tr>
<tr><th><var>OLD</var></th>
<tr><th>NEW</th>
<td>The global or session longstring must already exist, that is, it must have been created with a previous <var>$Lstr_Global</var>, <var>$Lstr_Session</var>, <var>$Lstr_Global_Set</var>, or <var>$Lstr_Session_Set</var> call.</td></tr>
 
<tr><th><var>NEW</var></th>
<td>The global or session longstring must not already exist. The global or session longstring will be created if this is the case.</td></tr>
<td>The global or session longstring must not already exist. The global or session longstring will be created if this is the case.</td></tr>
<tr><th>PREP</th>
 
<tr><th><var>PREP</var></th>
<td>Same as ANY but empties the longstring if it has data.</td></tr>
<td>Same as ANY but empties the longstring if it has data.</td></tr>
<tr><th>PREPANY</th>
 
<tr><th><var>PREPANY</var></th>
<td>Same as ANY but empties the longstring if it has data.</td></tr>
<td>Same as ANY but empties the longstring if it has data.</td></tr>
<tr><th>PREPOLD</th>
 
<tr><th><var>PREPOLD</var></th>
<td>Same as OLD but empties the longstring if it has data.</td></tr>
<td>Same as OLD but empties the longstring if it has data.</td></tr>
<tr><th>PREPNEW</th>
 
<tr><th><var>PREPNEW</var></th>
<td>Same as NEW.</td></tr>
<td>Same as NEW.</td></tr>
<tr><th>ANYPREP</th>
 
<tr><th><var>ANYPREP</var></th>
<td>Same as ANY but empties the longstring if it has data.</td></tr>
<td>Same as ANY but empties the longstring if it has data.</td></tr>
<tr><th>OLDPREP</th>
 
<tr><th><var>OLDPREP</var></th>
<td>Same as OLD but empties the longstring if it has data.</td></tr>
<td>Same as OLD but empties the longstring if it has data.</td></tr>
<tr><th>NEWPREP</th>
 
<td>Same as NEW.
<tr><th><var>NEWPREP</var></th>
<td>Same as NEW.</td></tr>
</table>
</td></tr></table>
</td></tr></table>


</ul>
==Usage notes==
 
<ul>
<var>$Lstr_Global</var> and <var>$Lstr_Session</var> will automatically unbind a previous bind for its input longstring %variable. In such a case, the value of the previously bound global or session longstring is not affected.  
<li><var>$Lstr_Global</var> and <var>$Lstr_Session</var> will automatically unbind a previous bind for its input longstring %variable. In such a case, the value of the previously bound global or session longstring is not affected.  


Only one %variable in a request can be bound to the same global name. To access the same global name in multiple complex subroutines, use a COMMON %variable in the <var>$Lstr_Global</var> or <var>$Lstr_Session</var> call.  
Only one %variable in a request can be bound to the same global name. To access the same global name in multiple complex subroutines, use a COMMON %variable in the <var>$Lstr_Global</var> or <var>$Lstr_Session</var> call.  


In the following example, the global longstring <tt>SUNSHINE</tt> is set to the value <tt>PARAKEET</tt>.
<li><var>$Lstr_Global</var> and <var>$Lstr_Session</var> have independent namespaces. That is, the same name used for <var>$Lstr_Global</var> and <var>$Lstr_Session</var> references different longstrings. A <var>$Lstr_Session</var> call when there is no session open causes a request cancellation.  


<p class="code"> %RC = $Lstr_Global('SUNSHINE', %LONG)
<li>You can clean up any global longstrings with <var>[[$Lstr_Global_Del]]</var>, which can be issued whether or not a name was referenced in the current procedure with a <var>$Lstr_Global</var>. You can clean up any session longstrings with <var>$Lstr_Session_Del</var>, which can be issued whether or not a name was referenced in the current procedure with a <var>$Lstr_Global</var>.
%LONG = 'PARAKEET'
</ul>
</p>


<var>$Lstr_Global</var> and <var>$Lstr_Session</var> have independent namespaces. That is, the same name used for <var>$Lstr_Global</var> and <var>$Lstr_Session</var> references different longstrings. A <var>$Lstr_Session</var> call when there is no session open causes a request cancellation.
==Example==
In the following example, the global longstring <code>SUNSHINE</code> is set to the value <code>PARAKEET</code>:


You can clean up any global longstrings with [[$Lstr_Global_Del]], which can be issued whether or not a name was referenced in the current procedure with a $Lstr_Global. You can clean up any session longstrings with $Lstr_Session_Del, which can be issued whether or not a name was referenced in the current procedure with a $Lstr_Global.
<p class="code">%rc = $Lstr_Global('SUNSHINE', %long)
 
%long = 'PARAKEET'
<var>$Lstr_Global</var> and <var>$Lstr_Session</var> are new in Version 6.3 of the <var class="product">[[Sirius Mods]]</var>.<p>
</p>


<h2>Products authorizing $Lstr_Global and $Lstr_Session</h2>
<h2>Products authorizing $Lstr_Global and $Lstr_Session</h2>
Line 77: Line 87:
<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 and $Lstr_Session]]
[[Category:$Functions|$Lstr_Global and $Lstr_Session]]

Revision as of 23:40, 25 October 2012

$Lstr_Global and $Lstr_Session: Bind to global/session longstring

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no direct OO equivalent for the $Lstr_Global and $Lstr_Session functions because setting Longstrings as session or global variables can be accomplished on the declarations.

This function binds a longstring %variable to a global or session longstring. That is, the longstring %variable assumes the value of the global or session longstring and any changes to the longstring %variable are reflected in the global or session longstring. The global or session longstring could be one that already existed because of a previous $Lstr_Global, $Lstr_Session, $Lstr_Global_Set, or $Lstr_Session_Set call.

Syntax

<section begin="syntax" />%rc = $Lstr_Global(gname, lstr, options) <section end="syntax" />

%rc = $Lstr_Session(gname, lstr, options)

Syntax terms

%rc A numeric return code that is set to 0 or, if CCATEMP is full, to -3.
gname The name of the global or session longstring. This is an optional argument and, if not specified, the longstring %variable is unbound from whatever global or session longstring it's bound to, if any, and then set to null.
lstr A longstring %variable. It cannot be a complex subroutine parameter. This is a required argument.
options The type of processing $Lstr_Global or $Lstr_Session is to perform. Valid values of this optional argument are listed below; the default is ANY:
ANY If the global or session longstring already exists, it is referenced with its current contents. If it does not exists, a new null global or session longstring is created.
OLD The global or session longstring must already exist, that is, it must have been created with a previous $Lstr_Global, $Lstr_Session, $Lstr_Global_Set, or $Lstr_Session_Set call.
NEW The global or session longstring must not already exist. The global or session longstring will be created if this is the case.
PREP Same as ANY but empties the longstring if it has data.
PREPANY Same as ANY but empties the longstring if it has data.
PREPOLD Same as OLD but empties the longstring if it has data.
PREPNEW Same as NEW.
ANYPREP Same as ANY but empties the longstring if it has data.
OLDPREP Same as OLD but empties the longstring if it has data.
NEWPREP Same as NEW.

Usage notes

  • $Lstr_Global and $Lstr_Session will automatically unbind a previous bind for its input longstring %variable. In such a case, the value of the previously bound global or session longstring is not affected. Only one %variable in a request can be bound to the same global name. To access the same global name in multiple complex subroutines, use a COMMON %variable in the $Lstr_Global or $Lstr_Session call.
  • $Lstr_Global and $Lstr_Session have independent namespaces. That is, the same name used for $Lstr_Global and $Lstr_Session references different longstrings. A $Lstr_Session call when there is no session open causes a request cancellation.
  • You can clean up any global longstrings with $Lstr_Global_Del, which can be issued whether or not a name was referenced in the current procedure with a $Lstr_Global. You can clean up any session longstrings with $Lstr_Session_Del, which can be issued whether or not a name was referenced in the current procedure with a $Lstr_Global.

Example

In the following example, the global longstring SUNSHINE is set to the value PARAKEET:

%rc = $Lstr_Global('SUNSHINE', %long) %long = 'PARAKEET'

Products authorizing $Lstr_Global and $Lstr_Session