| Preprocessor question: defined value substitution [message #482346] |
Wed, 26 August 2009 06:31  |
David Lucena Messages: 74 Registered: August 2009 |
Member |
|
|
Hi. I'm am trying to do something that I supposed that the preprocessor would do, but I am not sure if this behaviour is implemented.
I know the code would seem dumb, but is just for making the post short.
//#define ROWS = 10
int Rows = ROWS
It gives me errors because ROWS is not defined.
Regards.
David Lucena.
|
|
|
| Re: Preprocessor question: defined value substitution [message #482353 is a reply to message #482346] |
Wed, 26 August 2009 06:56   |
David Lucena Messages: 74 Registered: August 2009 |
Member |
|
|
Looking at the antenna preprocessor source code I have found something and I've tested it. Its something limited, but works.
You will define your symbol somewhere
And to recover its value and assing it:
int Rows;
//#expand Rows = %ROWS%;
That has its limitations, as you cannot do things like:
CreateRows( #expand %ROWS% );
But instead you have to do:
int Rows;
//#expand Rows = %ROWS%;
CreateRows( #expand %ROWS% );
Anyone has gone deep in the preprocessor? Maybe I'll try the antenna documentation, now that I remember.
Edited: I should had take a look to the antenna documentation. It is just I forget that preprocessor is the antenna, not the MTJ... Sorry.
[Updated on: Wed, 26 August 2009 06:58] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01671 seconds