The “initial state” means the following for:
indices: undefined
object references/pointers: initialized to NULL
other data: value from the VALUE clause, if specified;
otherwise, undefinedfiles: file connector set to be not in any open mode.
The last-used” state means the following for:
data: state following the last preceding update
files: state following the last preceding update
The states of data or files on calling a method or program depend on
the section in which they are defined and other clauses of the definition
what occurred earlier on executing the run unit
|
Preceding execution sequence |
|||||
Method |
Program |
|||||
First call |
Further calls |
with INITIAL1 |
without INITIAL |
|||
First / further calls |
Very first call |
First call |
Other calls |
|||
Working Storage |
initial |
last-used |
initial |
initial |
initial |
last-used |
Local Storage |
initial |
initial |
initial |
initial |
initial |
initial |
Linkage 3 |
last-used |
last-used |
last-used |
last-used |
last-used |
last-used |
1 The program contains the clause itself or is itself contained in such a program
2 A Cancel on the program itself or any other program in which it is contained
3 Refers to the currently passed parameters