Using SAVELIST_SUB (Functions/Subroutines/Programs)

SAVELIST_SUB

SAVELIST_SUB( saveTableName, saveRecName, options )

Using SAVELIST_SUB

Saves a currently-active select list to a table, from where it can be re-activated using the TCL GETLIST command or the subroutine GETLIST_SUB. The select list to be saved can be active or latent; if the list is latent, it is resolved before being saved. By default, the select list remains active after being saved.

saveTableName

The name of the table in which to save the list. The default is LISTS. The table must be attached.

saveRecName

The name of the list to save. The name should contain no spaces or system delimiters (@VM, @FM, etc.). We recommend that you limit punctuation to underscore characters (_).

options

OptionMeaning
C (Clear) Clears the select list after saving it. The default is that the list remains active.

Values returned

The return status of SAVELIST_SUB is indicated by the system variable @file.error. Multiple errors are delimited with record marks (@RM). The error number appears in field 1 of each @file.error "record", and additional information about the error appears in field 2. Possible errors are:

Error Meaning Add'l Info.
W166 Successful save. <2,1> table

<2,2> list key

<2,3> key count
S140 Process not allowed on a Runtime version of Advanced Revelation.
(continued)

Error Meaning Add'l Info.
S142 No active list to save.
401 Invalid table name in saveTableName. <2> table
421 User aborted (while a latent list was being resolved)<2> key

<3> table
select.seek

error
Unable to retain the active select list.

Under some circumstances, SAVELIST_SUB sets these values for status( ):

status( ) Meaning
-2 Successful save.
-1 User aborted the process by pressing [Esc] (this is only possible if the select list was unresolved).
1 An error occurred.

Correct use of SAVELIST_SUB

perform "SELECT SAMPLE_CUSTOMERS LATENT (S)"

call savelist_sub( "", "CUSTLIST", "")

if status() ne -2 then

call fsmsg()

end else

reccount = @file.error<2,3>

text = "%1% rows selected and saved!"

call msg( text, "", "", reccount )

end

/* savelist is still active */

perform "LIST SAMPLE_CUSTOMERS CITY"

  • kb/kb_articles/kb0059.txt
  • Last modified: 2024/01/30 13:36
  • by 127.0.0.1