delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

How do you change the data type? I need to change a int to a boolean


How do you change the data type? I need to change a int to a boolean.

TOP

You can't directly.  Try something like:
Code:
  1. my_bool = !( new Integer( my_int ).equals( new Integer( 0 ) ) );
Copy Code
or, probably faster:
Code:
  1. my_bool = my_int > 0 ? true : false;
Copy Code




How do you change the data type? I need to change a int to a boolean

TOP

Back Forum