View Full Version : Boolean argument

06 June 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

06 June 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 January 2006, 12:00 PM
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.