05-02-2013, 07:44 AM
boriel Wrote:LCD Wrote:I suppose, it is possible to define multiple macros, right?Yes, or that's the idea.
-D LANG=de -D VERSION=hard -D RATING=adult![]()
Note this is currently *beta* in 1.3.0.
The next version will have it more tested, since macros now allows also #if directives. e.g.
In a similar (but limited) way, as explained here: <!-- m --><a class="postlink" href="http://gcc.gnu.org/onlinedocs/cpp/If.html#If">http://gcc.gnu.org/onlinedocs/cpp/If.html#If</a><!-- m -->Code:#if LANG==de && VERSION==hard || RATING=adult
PRINT "bla bla"
#else
PRINT "ble ble"
#endif
Oh, that is great and I can imagine some uses for it, apart from Languages.
So this is C Plusplus syntax...
I think, I will try to use it without splitting into multiple sources:
Code:
#ifndef LANG
' if no LANG defined, fallback to English as default
#define LANG en
#endif
#if LANG==en
#define HELLO_WORLD "HELLO WORLD"
#define OTHER_TEXT "OTHER TEXT"
#endif
#if LANG==de
#define HELLO_WORLD "HALLO WELT"
#define OTHER_TEXT "ANDERER TEXT"
#endif
PRINT OTHER_TEXT
PrintString(@Message1)
END
Message1:
ASM
DEFB 16,7
DEFM HELLO_WORLD
END ASM
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!