9.185 SAVE_LIST

Note: Built-In Function Rules     Usage Options

Permanently or temporarily saves the contents of a working list.

Portability Considerations

SAVE_LIST and RESTORE_SAVED_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

L

Req

Working List to be saved

1

10



2

N

Req

Length of each list entry i.e. Total length of all fields in the entry. For packed fields allow (SIZE/2)+1.
This parameter is ignored for RDMLX lists. Any value can be specified. Whatever the list entry length is, it will be saved correctly.

1

15

0

0

3

A

Opt

Type of list

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

If not specified, the list is assumed to be temporary.

1

1



4

N

Opt

Retention period (in days) for temporarily saved lists.

Only use a value in the range 1 to 90. If not specified, a default value of 7 is assumed for temporary lists.

1

2

0

0

5

A

Opt

Name that list is to be saved with. If this argument is not specified, or passed as blank a unique list name will be automatically assigned.

10

10



Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Returned name of saved list

10

10



Technical Notes

Example

A list is displayed to the user. The user can select entries from the list to be output to a printer. By saving a list of selected entries this can later be restored by a print job to create the output.

     DEF_LIST   NAME(#CLIENTS) FIELDS((#SELECTOR *SEL) #CLICDE #CLIDES)
DEF_LIST   NAME(#SAVLST) FIELDS(#CLICDE #CLIDES) TYPE(*WORKING)
DEFINE     FIELD(#LSTNME) TYPE(*CHAR) LENGTH(10)
********** Clear the list
CLR_LIST   NAMED(#CLIENTS)
CLR_LIST   NAMED(#SAVLST)
********** Build the browselist
SELECT     FIELDS(#CLIENTS) FROM_FILE(CLIMASTER)
ADD_ENTRY  TO_LIST(#CLIENTS
ENDSELECT
********** Allow user to select clients for print
DISPLAY    BROWSELIST(#CLIENTS)
SELECTLIST NAMED(#CLIENTS) GET_ENTRYS(*SELECT)
ADD_ENTRY  TO_LIST(#SAVLST)
ENDSELECT
********** Save the list
USE        BUILTIN(SAVE_LIST) WITH_ARGS(#SAVLST 50 T 10) TO_GET(#LSTNME)
********** Submit job to print client information
SUBMIT     PROCESS(PRINTS) FUNCTION(CLIENTS) EXCHANGE(#LSTNME)