12-10-2022, 07:30 AM
(12-10-2022, 05:41 AM)Pete Wrote: _EXIT covers all exit routines, which is why I put that INKEY Esc to end line in the code; otherwise, you'd have to shut it down with Task manager.This is a keyword to be told: newbie beware! "Experienced" BASIC coder included! It's because so much code for QBasic, for example, doesn't even have [ESC] or any other key to clean up and exit the program. It's because some people absolutely hate, "Are you sure you want to quit?" prompts from professional applications. One of those people doesn't think about filing a lawsuit and the other side just wanted to play it safe with that question message box that irritated him/her.
If "_EXIT" is not properly used, it could cause a lot of frustration. In the least, the programmer could clench his/her firsts for a few seconds then open Task Manager and kill his/her own program in memory. "Doing this could cause system instability," Windows could bark back but he/she doesn't care when he/she wants to be in complete control. Yet too lazy to program "INKEY$ = CHR$(27)" or something alike, too lazy to check string input for an empty string, too lazy to decide for one corner of the desktop screen the mouse pointer could be driven into... ever heard of GNOME yet?
One thing I found strange about Unix/Linux is that "kill" terminal command, in its default behavior, does not remove a process from memory. It sends a signal which is like, "Please go away" or "You need to get the eich off!" Sometimes the offended program is inclined to obey. Oftentimes the offended program finds a seg-fault and ends that way.
Yes, it happened to me, and I didn't like it. I much preferred programming for [ESC] keypress and did that since I was stuck using QuickBASIC on Windows7. It boggles me that someone who is very popular on these forums had to teach me [ALT][F4] and keeps getting away with not programming a check for an "exit keystroke" and with not using "_EXIT"... but I could be wrong.
@Pete I thought you were strictly a Looney Tunes guy, now you reminded me of the most ridiculous Hannah-Barbera could get with their cartoons...