function(variable as boolean) legal?

The manual doesn’t indicate that this is possible, but I wonder… the function can return boolean if it is function(variable as integer) as boolean but boolean is not listed as a type of function parameter. Are we forced to use an integer 0 or 1 to represent a boolean value when calling a function or is type object necessary?

  • Joel

See section 3.2 of the BrightScriptReferenceManual.pdf. Boolean is definitely a type.

nevermind, looks like it should be “as dynamic” and it can be any type… function(isboolean as dynamic)

  • Joel

I was looking at 5.14 which only lists the following types as function parameters:

• Integer
• Float
• Double
• String
• Object
• Dynamic

Fair enough… but trust me, boolean is perfectly legal as a parameter. I use it all the time.

Joel,

You’ve found a documentation bug. Thanks for pointing it out!

functions and indeed return the type Boolean.

–Kevin