forums

TNT Basic Forums > Programming Q&A
Declaring Booleans...
< Last Thread     Next Thread >
Author
Thread        Post A Reply

06-01-2003 09:28

Posted by:
Freefall

Click Here to Email Freefall   Find more posts by Freefall

OK, I probably should have asked this before, but I didn't so I'll ask now.
How do you declare a boolean? So far I have just used a string with the value either "True" or "False" but I would prefer not to have to type the quotes each time aswel.
I'm assuming that its posible due to 2 things:
A) when you type true or false, it highlights it blue.
B) no programming language would be complete without it.

how do I do it?

06-01-2003 14:27

Posted by:
anoved

Location:
Upstate NY

Find more posts by anoved

boolean

Try declaring your variable as an int. 0 is considered false, and anything else is considered true (and you can assign true and false values to it like you said). I think there's a section about boolean expressions under 'expressions' in the TNT basic help.

Hope this helps!

06-01-2003 18:07

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

In fact, true and false are like variables in TNT. True equals 1 and false 0.


int execution=true
if execution then continue()

OR :

int execution=1
if execution=1 then continue()


are both accepted.

06-02-2003 02:23

Posted by:
Freefall

Click Here to Email Freefall   Find more posts by Freefall

Oh Thanks, that works.

Sam

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.