12.07.2015 Views

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Automatic conversion to BooleanWhen a function, method or statement which expects a Boolean value as one of its argumentsis passed a non-Boolean value, this value is automatically converted to a Boolean value asfollows:♦The number 0 yields false.♦The empty string "" yields false.♦The null value yields false.♦The undefined value yields false.♦Any other non-Boolean values yield true.For example:"The 10 commandments".indexOf(10) -> 4"The " + 10 + " commandments" -> "The 10 commandments"if ("") writeln("True"); else writeln("False");if (123) writeln("True"); else writeln("False");This displays “False”, then “True”.I L O G O P L D E V E L O P M E N T S T U D I O L A N G U A G ER E F E R E N C E M A N U A L233

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!