GLBasic forum

Main forum => GLBasic - en => Topic started by: Gary on 2010-Jan-19

Title: ?define question
Post by: Gary on 2010-Jan-19
I have checked the manual, searched for forums but cannot see where I am going wrong when I try to use ?DEFINE

I am porting some C code and it has heavy use of #DEFINE which I assumed I could just swap for ?DEFINE but it seems im doing something wrong

This is some example code

Code (glbasic) Select
?DEFINE SPIN_TO_WIN 1
PRINT SPIN_TO_WIN,0,0
SHOWSCREEN
KEYWAIT


and this displays 0 instead of the 1 I expected.

Thanks for your help

Gary
Title: Re: ?define question
Post by: MrTAToad on 2010-Jan-19
?DEFINE'd variables can't be accessed from GLBasic - they are really for changing what gets compiled.

If you want to convert #DEFINE, you would use CONSTANT
Title: Re: ?define question
Post by: Gary on 2010-Jan-19
Ah ok, I understand

Thanks for the info