RE: BAJA mod by me.
BY: Beta to Aragorn on Wed Nov 18 1998 07:36 am
this is the structure that I was taught in class.
You took a class in BAJA? They don't have END_IF's in QBasic last I chec (I'm rusty though...)
They do, very much so. LOOP, and many other commands won't work unless a EN is after a IF/ELSEIF/ELSE. Also QB 4.5 and better gets mad at you... :)
Ah, been a while since I took a class in that (of course, I already new BASIC, and the class was 80% flowcharting)...
In C, <duck> END_IF's aren't needed in normal code because everything is done in blocks of code which are started and ended by { and } "curly-braces". For example:
if(something)
{
do_something;
keep_going;
}
else
{
do_something_else;
and_stuff;
}
The only time something like END_IF is used in C <duck again> to my knowledge is in preprocessor definitions (things that the compiler looks at while compiling the program rather than when the compiled program is run), which work like
#if something
do_something
#else
do_something_else
#endif
(as you can see it's very similar to the BAJA structure) It's very useful for using flags to cause the program to compile differently (e.g. for different compilers or OSes)
---
þ Synchronet þ þ Mars Base BBS - (360)882-0773 - Vancouver, WA