Breadcrumbs

convertToInteger() Operation for Booleans

Syntax

set anInteger = aBoolean.convertToInteger()
set anInteger = convertToInteger(true|false)

Semantics

Converts boolean values to integers. true is converted to 1, false to 0.

Substitutables

aBoolean

Can be any variable or object attribute having the type Boolean

Examples

Converts the value of the boolean variable to an integer having the value 0 or 1.

set i1 = b.convertToInteger();

Assigns 0 to integer i2 .

set i2 = convertToInteger(false);

Some Examples

Boolean Value

Integer Value

true

1

false

0

⬇️

ActionScript_TypeConversions_Example

Click here to download a simple example model that shows different possibilities for type conversions between Float, Integer, String, and Boolean types in Scheer PAS Designer.

📗