forums

TNT Basic Forums > Programming Q&A
comparing integers
< Last Thread     Next Thread >
Author
Thread        Post A Reply

01-15-2003 10:11

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

This If statement is fairly simple and looks OK to me, all it does is compare the integer values and tells the user the result, and records the result. There are no other errors in the entire code except this where 'D' is highlighted as, 'Expected a numeric value' All integers have been declared by the user before. .

if int a not=b and if not=c and a not=d
print "Your mystery shape is an irregular quaderateral..."
file write ans, kFileName
wait mouse click
Close file ans
end if
end

Thanks in advance to anyone who can shed some light on it.
Mark_667

01-15-2003 12:01

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

hohum...

"if int a not=b and if not=c and a not=d"

This one is a masterpiece... bah, strange sintax...

1)I' d use <> instead of not=, but I suppose not= could do, if you used it...
2)I did not understand that "int a", it floors a?

3)I think you should repeat "and if A not=c" instead of "and if not=c"

In what language are you writing?! :-)
I' m not surprised you get up to 120 errors!

Cheers
Matteo

01-15-2003 21:14

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Expressions

Hi,

I'm afraid you've mangled your expression a bit!

Your code:

if int a not=b and if not=c and a not=d

I think you may have meant:

if a<>b and c<>d

The <> means 'not equal to'. You could have also used:

if not (a=b) and not (c=d)

The following link in the TNT Basic help may also be useful:

http://www.tntbasic.com/learn/help/guides/booleanexpressions.htm

Cheers,

Mark

01-15-2003 23:51

Posted by:
eLL

Click Here to Email eLL   Find more posts by eLL

eh?

What ever happened to using '!' as 'not' , whatever happened to IEEE standards...especially since its a singular character and shouldn't appear in your code other than in a draw/print command...

oh well good to know...

//threeCheers

01-16-2003 23:06

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

to be not, or not to be !

Yeah, the ! as a not operator has been massively popularised by C and C++, but as far as I'm aware it's never been part of the basic language.

The official basic standard published by ANSI would obviously tell us, but I've not got it so I can't be sure.

Wonder what our biggest ommision/addition is that isn't inline with the standard....

Mark

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.