$ListSavL: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (minor wordsmithing)
 
(29 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Count and names of available global $lists</span>
<span class="pageSubtitle">Count and names of available global $lists</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListSavL function is [[to be entered]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListSavL function is the [[PersistentObjectInfo class]] which returns information about [[Global and session objects|global and session objects]] allocated to a thread.</p>


This function retrieves the count of items in, and names of, the $lists that have been saved by either the $List_Global, $ListSav, or <var>$ListSave</var> function and not, in the current request, restored by <var>$ListRst</var>.
This [[Calling Sirius Mods $functions|callable]] function retrieves the count of items in, and names of, the [[$lists]] for which both of these are true:
<ul>
<li>Saved by the <var>$List_Global</var>, <var>$ListSav</var>, or <var>$ListSave</var> function </li>


The <var>$ListSavL</var> function accepts one argument and returns a numeric error code. It is a callable $function (see [[Calling Sirius Mods $functions]]).
<li>Not, in the current request, restored by <var>$ListRst</var> </li>
</ul>


The first argument is the identifier of the $list that is to receive the results. The current contents of the $list are deleted and replaced with the item count and names of available saved $lists. Each $list item contains the 10-digit number of items, followed by a blank, followed by the name of a global $list not yet restored by <var>$ListRst</var> in the current <var class="product">User Language</var> request.
The <var>$ListSavL</var> function accepts one argument and returns a numeric error code.  


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />[%RESULT =] $ListSavL(list_identifier)
<p class="syntax">[<span class="term">%result</span> =] <span class="literal">$ListSavL</span>(<span class="term">list_identifier</span>)
<section end="syntax" /></p>
</p>
 
<ul>
<li><var class="term">%result</var> is a non-negative number indicating the number of saved $lists, or it is a negative error code.</li>
 
<li><var class="term">list_identifier</var> is the identifier of the $list that is to receive the results. The current contents of the $list are deleted and replaced with the item count and names of available saved $lists.
<p>
<p>
</p>
Each $list item contains the 10-digit number of items, followed by a blank, followed by the name of a global $list not yet restored by <var>$ListRst</var> in the current <var class="product">SOUL</var> request. </p></li>
<p>%result is a either zero, indicating success, or a negative error code.</p>
</ul>


<p class="code">  
===Return codes===
  -3 - Not enough room to store list of counts and names
<p class="code">>=0 &ndash; Number of suitable saved $lists found
  -5 - Required argument not specified
  -3 &ndash; Not enough room to store list of counts and names
  -6 - Invalid $list identifier
  -5 &ndash; Required argument not specified
</p>
  -6 &ndash; Invalid $list identifier
<p class="caption">$ListSavL return codes
</p>
</p>


==Example==
The following procedure uses <var>$ListSav</var> to save information in various lists, and uses <var>$ListSavL</var> and <var>$ListRst</var> to display the saved lists:
The following procedure uses <var>$ListSav</var> to save information in various lists, and uses <var>$ListSavL</var> and <var>$ListRst</var> to display the saved lists:
<p class="code"> B
<p class="code">B
  ...
  ...
%RESULT = $ListSav(%LIST, 'name')
%RESULT = $ListSav(%LIST, 'name')
  ...
  ...
END
END
   
   
CLOSE ALL
CLOSE ALL
   
   
B
B
   
   
%SAVED = $ListNew
%SAVED = $ListNew
%RESULT = $ListSavL(%SAVED)
%RESULT = $ListSavL(%SAVED)
FOR %I FROM 1 TO $ListCnt(%SAVED)
FOR %I FROM 1 TO $ListCnt(%SAVED)
    %N = $ListInf(%SAVED, %I, 1, 10)
  %N = $ListInf(%SAVED, %I, 1, 10)
    %NAME = $ListInf(%SAVED, %I, 12)
  %NAME = $ListInf(%SAVED, %I, 12)
    PRINT %N ' items in ' %NAME ':'
  PRINT %N ' items in ' %NAME ':'
    %LIST = $ListRst(%NAME)
  %LIST = $ListRst(%NAME)
    FOR %J FROM 1 TO %N
  FOR %J FROM 1 TO %N
      PRINT $ListInf(%LIST, %J)
      PRINT $ListInf(%LIST, %J)
    END FOR
  END FOR
END FOR
END FOR
   
   
END
END
</p>
</p>
<p class="code">


<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
==Products authorizing {{PAGENAMEE}}==
<li>[[Sirius functions]]</li>
<ul class="smallAndTightList">
<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>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
   
   
</p>
<p>
</p>
[[Category:$Functions|$ListSavL]]
[[Category:$Functions|$ListSavL]]

Latest revision as of 18:28, 11 April 2016

Count and names of available global $lists

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListSavL function is the PersistentObjectInfo class which returns information about global and session objects allocated to a thread.

This callable function retrieves the count of items in, and names of, the $lists for which both of these are true:

  • Saved by the $List_Global, $ListSav, or $ListSave function
  • Not, in the current request, restored by $ListRst

The $ListSavL function accepts one argument and returns a numeric error code.

Syntax

[%result =] $ListSavL(list_identifier)

  • %result is a non-negative number indicating the number of saved $lists, or it is a negative error code.
  • list_identifier is the identifier of the $list that is to receive the results. The current contents of the $list are deleted and replaced with the item count and names of available saved $lists.

    Each $list item contains the 10-digit number of items, followed by a blank, followed by the name of a global $list not yet restored by $ListRst in the current SOUL request.

Return codes

>=0 – Number of suitable saved $lists found -3 – Not enough room to store list of counts and names -5 – Required argument not specified -6 – Invalid $list identifier

Example

The following procedure uses $ListSav to save information in various lists, and uses $ListSavL and $ListRst to display the saved lists:

B ... %RESULT = $ListSav(%LIST, 'name') ... END CLOSE ALL B %SAVED = $ListNew %RESULT = $ListSavL(%SAVED) FOR %I FROM 1 TO $ListCnt(%SAVED) %N = $ListInf(%SAVED, %I, 1, 10) %NAME = $ListInf(%SAVED, %I, 12) PRINT %N ' items in ' %NAME ':' %LIST = $ListRst(%NAME) FOR %J FROM 1 TO %N PRINT $ListInf(%LIST, %J) END FOR END FOR END

Products authorizing $ListSavL