Discussions related to Visual Prolog
User avatar
drspro2
VIP Member
Posts: 107
Joined: 28 Apr 2006 12:03

convert a boolean to integer

Post by drspro2 »

dear VP,

what is the best way to convert a boolean to integer, should we use trytoTerm?

until now i allways used : Var2 = Var + 0, but that doesnt work , i think i can find something
that works , but i would like to know what the official method would be to do it


it should be tryConvert ?

only thing that work seems to be: uncheckedConvert
Harrison Pratt
VIP Member
Posts: 460
Joined: 5 Nov 2000 0:01

Re: convert a boolean to integer

Post by Harrison Pratt »

Code: Select all

 INT = boolean::toBooleanInt(BOOLEAN)
User avatar
drspro2
VIP Member
Posts: 107
Joined: 28 Apr 2006 12:03

Re: convert a boolean to integer

Post by drspro2 »

AHa , thankyou