PDA

View Full Version : Boolean argument


Nicool
06-23-2003, 06:54 PM
Why doesn't it work?

global proc test (bool $bool) {
if ($bool == on) {
print "ok";
}
}
test(on); //true, false, 1, 0, on or off

mark_wilkins
06-23-2003, 07:35 PM
That doesn't work because "bool" is not a valid data type for variables. It is a valid type for attributes, though.

Try this instead:


global proc test (int $bool) {
if ($bool) {
print "ok";
}
}
test(1); //true, false, 1, 0, on or off

CGTalk Moderation
01-15-2006, 11:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.