06-04-2023, 11:59 PM
(06-04-2023, 05:38 PM)TempodiBasic Wrote: @NasaCowWell, that's what I am trying to figure out by copying the wiki example. I was just trying to get it to system out still without doing anything else but it also said you need to an initial _EXIT to enable the use.
on wikipage of _EXIT you find these instructions:
Quote: If a return value is not 0 the program can handle an exit request at a more convenient time if necessary.....
After being read, the _EXIT value is reset to 0 so store the value when a program delays an exit request.
Note: Once _EXIT has been used once, you must monitor your program by checking it for user _EXIT requests.
Don't just use _EXIT once to prevent a user from exiting a program early, as that constitutes bad practice.
can you find another way to manage the issue about closing by brute force your program?
(06-04-2023, 08:35 PM)TerryRitchie Wrote:This is actually a great idea, will force run all my normal saving routinues. Does _EXIT in this case retain it value so I can system out afterwards or should I set a flag to retain the value of _EXIT? (Pressing the 'X' multiple times to system out may annoy the user...)(06-04-2023, 05:38 PM)TempodiBasic Wrote: @NasaCow
on wikipage of _EXIT you find these instructions:
Quote: If a return value is not 0 the program can handle an exit request at a more convenient time if necessary.....
After being read, the _EXIT value is reset to 0 so store the value when a program delays an exit request.
Note: Once _EXIT has been used once, you must monitor your program by checking it for user _EXIT requests.
Don't just use _EXIT once to prevent a user from exiting a program early, as that constitutes bad practice.
can you find another way to manage the issue about closing by brute force your program?
I just include _EXIT in my checks for the user wanting to leave the program:
Foo = _EXIT
DO
.
. <code>
.
LOOP UNTIL _KEYDOWN(27) OR _EXIT ' ESC pressed or window X clicked
WHILE NOT EndOfLife(1)
HappyLife = HappyWife - (Money * Time * Travel * Gifts)
Kids = (NoTime * LackOfLove) MOD NumOfKids
IF Retirement <> Rich THEN YearsOnJob = YearsOnJob + 1 ELSE SeeTheWorld
WEND
HappyLife = HappyWife - (Money * Time * Travel * Gifts)
Kids = (NoTime * LackOfLove) MOD NumOfKids
IF Retirement <> Rich THEN YearsOnJob = YearsOnJob + 1 ELSE SeeTheWorld
WEND