$ListSavL: 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. The OO equivalent for the $ListSavL function is [[to be entered]].</p>
<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>


This function retrieves the count of items in, and names of, the $lists that have been saved by either the $LIST_GLOBAL, $LISTSAV, or $ListSave function and not, in the current request, restored by $ListRst.  
This function retrieves the count of items in, and names of, the $lists that have been saved by either the $List_Global, $ListSav, or $ListSave function and not, in the current request, restored by $ListRst.  


The $ListSavL function accepts one argument and returns a numeric error code. It is a callable $function (:hdref refid=callfun.).  
The $ListSavL function accepts one argument and returns a numeric error code. It is a callable $function (see [[Calling Sirius Mods $functions]]).  


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 $ListRst in the current User Language request.
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 $ListRst in the current User Language request.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListSavL(list_identifier)
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListSavL(list_identifier)
Line 15: Line 16:
</p>
</p>
<p class="caption">%RESULT is a either zero, indicating success, or a negative error code.</p>
<p class="caption">%RESULT is a either zero, indicating success, or a negative error code.</p>
<p class="code">  
<p class="code">  
  -3 - Not enough room to store list of counts and names
  -3 - Not enough room to store list of counts and names
Line 22: Line 24:
<p class="caption">$ListSavL return codes
<p class="caption">$ListSavL return codes
</p>
</p>


The following procedure uses $ListSav to save information in various lists, and uses $ListSavL and $ListRst to display the saved lists:
The following procedure uses $ListSav to save information in various lists, and uses $ListSavL and $ListRst to display the saved lists:
Line 38: Line 39:
  %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
   
   

Revision as of 17:49, 10 February 2011

<section begin="desc" />Count and names of available global $lists<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListSavL function is to be entered.

This function retrieves the count of items in, and names of, the $lists that have been saved by either the $List_Global, $ListSav, or $ListSave function and not, in the current request, restored by $ListRst.

The $ListSavL function accepts one argument and returns a numeric error code. It is a callable $function (see Calling Sirius Mods $functions).

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 $ListRst in the current User Language request.

Syntax

<section begin="syntax" /> [%RESULT =] $ListSavL(list_identifier) <section end="syntax" />

$ListSavL Function

%RESULT is a either zero, indicating success, or a negative error code.

-3 - Not enough room to store list of counts and names -5 - Required argument not specified -6 - Invalid $list identifier

$ListSavL return codes

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