IBM 5110 User Manual page 60

Apl
Table of Contents

Advertisement

3.
Store the variable in the data file. For example, you might use the
following user-defined functions:
The left argument must be 1 to
expunge the variable name from
the active workspace; otherwise,
the left argument must be O.
... ·1
C'
' : 0-
V I::' 1"1",-, . . . , /
'If ,.)
~'t
,., .... ..
IJ:! .. .
V EXPUNGE SAVE VAR;MASK;X
The right argument is the variable
name enclosed in single quotes .
[1]
I::~
]
[3]
1.
(O::::[]NC 'SAVELIBT')/'
BAVELIBT~"O
Op"
'"
!«pSAVELIST)[lJ<pVAR~)VAR)/'SAVELIST~SAVELIST
BY VAR'
!(Nv/MASK~«(pSAVELIST)[lJtVAR)A,=SAVELIST»/'SAVELIST
~
SAVELIST
BY
VAR'
I:
1+]
NL~"
( (.)Sf.lVEI... I
ST)
[1. ]
[5J
DATSAVE~!VAR
[6]
CTL§~ij~~l/«NLtVAR)A,=SAVELIST)\l
[7]
~(O~i7eTI...SAVE)/ERROR
[8]
X~"O
[9]
!EXPUNGE/'X~DEX"
'/VAR,'" ,
[10]
'THE VARIABLE IS SAVED ',(X/'AND EXPUNGED')
[ll]
..
~O
[12J ERROR: 'SAVE FAILED'
V
VBY I:: []] '\I
This function is used
V
Z~"A
BY B; ROl,.J4t.--------, by the SAVE function.
[1]
A~"(2t(~)A),
1.
:1.)(.)(.01
[~~]
B~(2t(pB),
11)pB
[3]
ROW~lt(pA)rpB
[~J
A~(ROW,-ltpA)tA
[5]
B~(ROW,-ltpB)tB
[6:1
Z~
.. A
I
B
V
4.
At a later time, read the stored variable back into the active
workspace. For example, you might use the following
user-defined function:
_ - - - - - - - - - T h e right argument is the
V'FETCH[U::IV / '
variable name enclosed
V
Z~"FETCH
VAI~;
MASK; NL
in single quotes.
[1]
4(O=DNC 'SAVELIST')/NOTFOUND
[2]
~«pVAR~,VAR»NL~ltpSAVELIST)/NOTFOUND
[3]
~(Nv/MASK~(NLtVAR)A,=SAVELIST)/NOTFOUND
[4J
CTLSAVE~O,MASK\l
[5]
~(0~i7tTLSAVE)/0
[6]
Z~VAR,'
I§-~BuND'
[7]
lVAR ,
'~DATSAVE'
[8]
~O,DATSAVE~~ij-
[9]
NOTFOUN~Tl~VAR,'
IS NOT FOUND IN THE FILE'
V
Active Workspace Control
55

Advertisement

Table of Contents
loading

Table of Contents