strange action of CALLed programs
> > ok, i moved all of my source over to fujitsu 4 and compiled the
> > project. the main program when [f2] is pressed calls the "create
> > estimate" program. create estimate gets all the items on the estimate,
> > totals and saves them, then gets the customer's info. 2 screen i-o
> > routines that PERFORM UNTIL KEY-CODE = 4 ([f4] key pressed). the first
> > time i execute the program, the estimating works fine. the second time
> > the f2 key is pressed at the main screen, the called create estimate pgm
> > skips the 2 screen io routines. i finally added a line right at the
> > beginning of the called pgm's source to move zero to key-code. in
> > version 3, i never had this problem. anyone run into something like
> > this?
This is perfectly normal behaviour for a called program that
is called twice without an intervening CANCEL (or one that
works). When a called routine is first called it is loaded
into memory and the WS areas have the values specified by
the VALUE clauses, where these don't exist the memory is
initialised to some arbitrary value.
When the program exits it still remains resident, a
subsequent call does _not_ cause the ws values to be
reset, they are left as they were on exit. This is a
good thing as it allows the routine to remain active for
being called to do a variety of tasks.
To reset the memory of the called routine you need to
CANCEL it so it disappears from memory, then the next CALL
will reload it.
If you do have a CANCEL then it is not working.