Re: 3.0.3 - type boolean
- Posted by Alex Caracatsanis <sunpsych at ncable.com.au> May 12, 2007
- 571 views
Juergen Luethje wrote: > > Alex Caracatsanis wrote: > > [type boolean] > > > A serious, newbie question: why is this a useful type to check? [snip] > > Did this answer your question? > > Regards, > Juergen I think so Juergen. I understand you to say that by adopting your routine we will have a "standard" way of declaring a variable of type boolean (which is already inherent in some other languages, eg Java) and ensuring the validity of a value we assign to it; and this would make our programs easier to read and more logically consistent (ie "boolean" implies true/false, whereas "integer" or "constant" can mean other things as well). Yes? I hadn't thought of doing that. I've been using:
constant FALSE = 0 constant TRUE = 1
and assigning those values - eg setFlag = TRUE I understand the basics of using variables as flags (but am pretty shakey on using bits for this purpose). And I thank you for the particular example you used - I didn't know how to break out of nested loops using exit! Regards Alex Caracatsanis