Reference for Processing (BETA) version 0135+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

boolean()

Examples
String s = "true";
boolean b = boolean(s);
if (b) {
  println("The boolean is true");
} else {
  println("The boolean is false");
}
Description Converts a primitive datatype, string, or array to its boolean representation. The number 0 evaluates to false and all other numbers evaluate to true.
Syntax
boolean(val)
Parameters
val String, String[]
Usage Web & Application
Related boolean
Updated on February 09, 2008 04:38:52pm PST

Creative Commons License