Macros with embedded With

Just starting out? Need help? Post your questions and find answers here.
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Macros with embedded With

Post by citystate »

I noticed that Macros don't allow With...EndWith

why? is there a stack issue or something?

Code: Select all

Structure test
  x.i
  y.i
  z.b
End Structure

Macro ConstructTest(a, b, c, d)
  a=AllocateMemory(SizeOf(test))
  With a
    \x=b
    \y=c
    \z=d
  EndWith
EndMacro

ConstructTest(*var.test, -2600, 100, 10)
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Macros with embedded With

Post by Fred »

No, it's a limitation of the PureBasic preprocessor, as 'With/EndWith' are internally handled as macro block as well (so it can't be nested inside a macro).
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Re: Macros with embedded With

Post by citystate »

thanks Fred
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
Post Reply