Win7; 32bit; PB 5.50 b1 (x86); macro / unusemacro

Windows specific forum
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Win7; 32bit; PB 5.50 b1 (x86); macro / unusemacro

Post by HanPBF »

Hello,

I have the following files:
Test_Macro.pb:

Code: Select all

macro exp(P1)
	"P1:" + P1
endMacro

debug exp("P1")
MessageRequester("P1", exp("P1"))

undefineMacro exp

macro exp(P2)
	"P2:" + P2
endMacro

debug exp("P2")
MessageRequester("P2", exp("P2"))

undefineMacro exp
Then I use the commandline compiler:
"C:\Program Files (x86)\PureBasic\5.50 b1\Compilers\pbcompiler.exe" "D:\...\Test_Macro.pb" /PREPROCESS "Test_Macro.exp.pb"

That's expanded:

Code: Select all

macro exp(P1)
	"P1:" + P1
endMacro
debug "P1:" + "P1"
MessageRequester("P1", "P1:" + "P1")
macro exp(P2)
	"P2:" + P2
endMacro
debug "P2:" + "P2"
MessageRequester("P2", "P2:" + "P2")
Is of course an error because second exp tries to expand when compiling.

Can the macros be deleted from commandline PREPROCESS?

Thanks a lot!