Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, Could someone confirm my understanding of CANCEL (85 version). As I understa nd it, if I cancel a program that I have called, it should reset the working storage to initial values ready for the next time I call it again. And from the 85 version onwards, it should also cancel any programs were called by the program that I called. Right? I'm on Windows with Micros Focus Net Express 3.1, and have something like th is: Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll) Prog1 then cancels Prog2. Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll) Prog2 working storage has been reset. Prog3 working storage has *not* been reset. This would seem to contradict my understanding. So am I wrong, or is MF doin g something wrong? TIA, Richard
Post Follow-up to this message"Richard Antony Burton" <richardaburton-NOSPAM-@hotmail.com> wrote: >Hi, > >Could someone confirm my understanding of CANCEL (85 version). As I underst and >it, if I cancel a program that I have called, it should reset the working >storage to initial values ready for the next time I call it again. And from the >85 version onwards, it should also cancel any programs were called by the >program that I called. Right? > >I'm on Windows with Micros Focus Net Express 3.1, and have something like t his: > >Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll) >Prog1 then cancels Prog2. >Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll) >Prog2 working storage has been reset. >Prog3 working storage has *not* been reset. > >This would seem to contradict my understanding. So am I wrong, or is MF doi ng >something wrong? MF is doing it right. Prog3 must be cancelled explicitly by prog2, its logic al parent, or by prog1, which would be poor structure IMO. The Standard says a cancel will automatically cancel programs INCLUDED in pr og2, not those called by prog2. Included means nested compilations i.e. in the so urce file of prog2. If you want initial values always, an alternative to cancel is INITIAL in program-id.
Post Follow-up to this message"Robert Wagner" <robert.deletethis@wagner.net> wrote in message news:40d0bdd5.22483499@news.optonline.net... > MF is doing it right. Prog3 must be cancelled explicitly by prog2, its logical > parent, or by prog1, which would be poor structure IMO. Thanks for clearing that up. Richard.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.