ProvideX V8.20 > Language Reference > 2. Directives
295
SAVE DATA Directive
            Save Program Constants
Format
SAVE DATA filename$ [,ERR=stmtref], varlist
Where:
filename
Name of Variable Definition file in which to store constant.
stmtref
Program line number or label to transfer control to.
varlist
List of variables.
Description
This directive creates a Variable Definition file on disk that contains the names and
values of variables named in varlist. These variables and their values can then be
loaded into memory using the LOAD DATA directive. Variables loaded in this way
are read-only (constants). Global variables are not supported.
To change the values of variables in a Variable Definition file, you must repeat the
SAVE DATA process. When a Variable Definition file, is re-saved, the original
contents are replaced.
See Also
LOAD DATA Load Program Constants, p.195.
Example
CCOMPANY$="ABC Company"
DIVISION$="Laundry Division"
COMPANY_CODE=1
SAVE DATA "CO_DATA",COMPANY$,DIVISION$,COMPANY_CODE
START
LOAD DATA "CO_DATA"
DUMP
! ERR=0, CTL=0, RET=2
! Level=1
! PGN="<Unsaved>"
!  Loaded data....CO_DATA (C:\Documents and Settings\Default
User\Application Data\CO_DATA)
COMPANY$="ABC Company"
DIVISION$="Laundry Division"
COMPANY_CODE=1
COMPANY_CODE=2
Error #61: Authorization failure