sergio masci wrote: >> Olin Lathrop wrote: >> >>> I'm pretty sure that if I had been required to type END or something >>> more verbose than "}", the mistake would never have happened or I >>> would have noticed it much quicker. >> >> You can define preprocessor macros and use Begin and End instead of >> { and }. > > Noooooooooooooooooooooooooo......... I didn't say that I'd find it a good idea :) > I've seen this done and had to live with it for a while. > Really really REALLY bad idea. > > Consider, defined are: > > BEGIN { > END { > > IF if ( > THEN ) { > ELSE } else { > ENDIF } > > WHILE while ( > DO ) { > DONE } > > you find a piece of code that is several pages long and looks like: > > IF ... THEN > > ... // several pages of code here > > DONE > > What's the intent of this code? Was it supposed to be a loop or a > conditional? Did the original programmer have a brain fart while > writing this, start out writing a conditional, changed his mind part > way through and finished as if it were a loop (but forgot to go back > and change the IF to a WHILE). Isn't the compiler supposed to give > you a kick and force you to clarify this? Ah... this wouldn't have happened with Pascal-style redefinitions. Pascal, like C, treats all blocks alike, no matter the statement they're associated with. In neither language you have a means to distinguish them, like you do in BASIC. I haven't programmed enough with BASIC to be able to say whether I'd like it. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist