Macros in Panel Elements

Posted By: CanadianDavid

Macros in Panel Elements - 03/05/14 06:30

Any reason why macro definitions don't work in some elements such as a PANEL digits element? The following produces a "Number syntax" error:

Code:
#define A_MACRO_DEFINITION 0

PANEL* HUD = {
	digits(A_MACRO_DEFINITION , A_MACRO_DEFINITION, 0, *, 1, 1);
}


It seems this issue was also noticed by another user in this post.
Posted By: sivan

Re: Macros in Panel Elements - 03/05/14 09:16

I think it is mentioned in the manual. similarly they don't work in struct definitions too. or is it mentioned only for structs?
Posted By: oliver2s

Re: Macros in Panel Elements - 03/05/14 09:52

From the Manual: http://www.conitec.net/beta/define.htm

Quote:
#defines are valid within all subsequent C code, but ignored in script parts that are not C standard, such as effect code or engine objects definitions like PANEL*, MATERIAL* etc.
Posted By: jcl

Re: Macros in Panel Elements - 03/07/14 13:42

Structs are C standard and support macros, buts PANEL definitions don't.
© 2024 lite-C Forums