Page 1 of 1

C #define Equivalent?

Posted: Thu Jun 25, 2015 1:08 pm
by Steve Elliott2
Is there a Pure BASIC equivalent of C's pre-processor #define statement?

I know we can do this with variables - but not for other text substitutions?

Code: Select all

eg)

#Sound_Loop = #PB_Sound_Loop

Re: C #define Equivalent?

Posted: Thu Jun 25, 2015 1:22 pm
by spikey
Depends which function of #define you need to use.

You can define constants and enumerations, including string constants:-
http://www.purebasic.com/documentation/ ... tants.html

or parameterized identifiers using macros:-
http://www.purebasic.com/documentation/ ... acros.html

oh and you can check for pre-existing stuff (except macros) with the compiler function Defined.
http://www.purebasic.com/documentation/ ... tions.html

Re: C #define Equivalent?

Posted: Thu Jun 25, 2015 1:54 pm
by Steve Elliott2
Macro was what I was after - many thanks! :D