9.181 RESTORE_SAVED_LIST

Note: Built-In Function Rules     Usage Options

Restores the contents of a previously saved permanent or temporary working list.

Portability Considerations

RESTORE_SAVED_LIST and SAVE_LIST should be used in the same context. That is, you should not use SAVE_LIST from within a function run on the WEB and later restore the saved list from within a function run as a Visual LANSA function.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Name of previously saved list to be restored.

1

10



Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

L

Req

Working List for saved list to be loaded/restored into.

1

10



2

A

Opt

Return Code
'OK' - List retrieved
'OV' - List full
'NR' - List not found

2

2



3

N

Opt

Length of each list entry

1

15

0

0

4

A

Opt

Type of list
'P' - Permanent list
'T' - Temporary List

1

1



Technical Notes

Example

A list has been saved. This list is a list of clients that have been selected by user to be printed on a report. The name of the list has been passed to this job by the submitting job.

     DEF_LIST   NAME(#RSTLST) FIELDS((#CLICDE) (#CLIDES)) TYPE(*WORKING)
DEF_LINE   NAME(#LINE1)  FIELDS((#CLICDE) (#CLIDES) (#CLIAD1) (#CLIAD2) (#CLIAD3) (#CLIPHO) (#CLIFAX))
DEFINE     FIELD(#LSTNME) TYPE(*CHAR) LENGTH(10)
********** Clear the list
CLR_LIST   NAMED(#RSTLST)
********** Restore the list
USE        BUILTIN(RESTORE_SAVED_LIST) WITH_ARGS(#LSTNME) TO_GET(#RSTLST)
********** Process the list
SELECTLIST NAMED(#RSTLST)
FETCH      FIELDS(#LINE1) FROM_FILE(CLIMASTER) WITH_KEY(#CLICDE)
PRINT      LINE(#LINE1)
ENDSELECT
********** Close print file
ENDPRINT
********** Submit job to delete list
USE        BUILTIN(DELETE_SAVED_LIST) WITH_ARGS(#LSTNME)