$ListRst: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
(No difference)

Revision as of 19:11, 19 October 2012

Restore global $list

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no direct OO equivalent for the $ListRst function, as OO structures can easily be declared "Global" and shared between User Language invocations.

This function is used to restore a $list previously saved with either $List_Global and $List_Session or $ListSav and $ListSave functions. $ListRst is used with these $functions to pass a $list between requests.

The $ListRst function accepts one optional argument and returns a numeric result.

The first argument is a string which is the name which had been used to save the list. If this argument is omitted, the name is the null string.

Syntax

<section begin="syntax" /> %RESULT = $ListRst(name) <section end="syntax" />

$ListRst Function

%RESULT is set either to the identifier of the restored $list or to a negative number if an error has occurred.

All invocations of a particular call to $ListRst will always return the same $list identifier. Each time that call is executed, if the function is successful then any previous $list created by that call is deleted, and a new list is created.

After a $list is restored, it is no longer considered "saved" and will be cleaned up at procedure termination or RELEASE ALL RECORDS processing unless it is saved again. If you wish to restore a $list and you know that you want it accessible after the current User Language request, use $List_Global instead of $ListRst.

If a non-null global $list name has never been used, the $ListRst function does not require any CCATEMP access and hence is highly efficient. For example

B ... %RESULT = $ListSav END CLOSE ALL B %LIST = $ListRst ... END

demonstrates the use of $ListRst to restore a $list created and saved in a separate request. Because many Sirius Software products use $LISTSAV/$LISTRST with the null global $list name, care should be taken of the interaction between global $list names used by your applications and the null $list name.

-13 - Specified $list accessed in current request with $List_Global -14 - No $list is currently saved with specified name

$ListRst Completion Codes

Products authorizing $ListRst