Reputation: 589
I understand that START-OF-SELECTION
is triggered when the user executes the program (after the selection screen), but still there is something missing.
Example:
If I have the code:
gv_var = 2.
INITIALIZATION.
gv_var = 1.
the initialization code will be executed first, but if I have:
gv_var = 2.
START-OF-SELECTION.
gv_var = 1.
Start-of-selection will not be the first thing executed after the user executes.
So my question is: What exactly is the point of START-OF-SELECTION
if it is not the first thing that is executed after the selection screen?
Is it just to make the program easier to read?
Upvotes: 2
Views: 2767
Reputation: 18493
You may want to refresh your knowledge about Event Blocks in Executable Programs. INITIALIZATION
is run before START-OF-SELECTION
, and even before the display of the selection screen. The other important information is
In an executable program, any non-declarative statements that occur between the
REPORT
orPROGRAM
statement and the first processing block are also processed in theSTART-OF-SELECTION
block.
(described here)
Upvotes: 4