There was a lot of posts on this subject and they were helpfull. One more
thing remained unclear to me - I'll quote parts of few posts as a
reference:
========================================================================
...The first segment must contain all the code needed to process all
launch codes except:
- Normal launch
- Goto launch (sub-launch or new globals)
- All sub-launches where you have access to globals
(D. Epstein)
------------------------------------------------------------------------
... Segment 1 must contain all code called from launch codes that don't
have global variables. But saying "normal launch" is usually close
enough.)
-slj- (S. Johnson)
------------------------------------------------------------------------
>What about the methods that AppStart, AppStop, and AppEventLoop calls
>and the methods in AppHandleEvent(those Event handlers)?
All of these routines can be in any segment because they're only used on
normal launch and other launch codes where you have access to globals.
>Another question is can the methods in the second segment use Global
>Variables?
No. All routines which access globals must be in the first segment.
-
Danny Epstein
========================================================================
It's clear that handlers (code) for any launch that doesn't have access to
globals must be in the 1st segment, but:
## if I have part of the code for Normal launch handling and that code
works with globals - may I put it into the 2nd segment? (I'm refering to
3rd excerpt, I'm not sure what Danny ment.)
Ie. can globals be accessed in 2nd segment under Normal launch?
-DR