![]() |
|
#include MACRO - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://forum.boriel.com/forumdisplay.php?fid=16) +---- Thread: #include MACRO (/showthread.php?tid=1248) |
#include MACRO - RandomiserUsr - 2021-08-21 I wonder if you could show some examples of how to use #include MACRO introduced in 1.5.1 as I don't see anything in the wiki thanks RE: #include MACRO - boriel - 2021-08-24 Include macro means you can #define MACRO <something> and later do #include MACRO so it will get replaced and do the include properly. This allows dynamically including things even from the command line. For example: Code: #define CONCAT(x,y) x##yThis can be compiled with Code: zxbc file.bas -D LANG=ESwhich will define the macro LANG with the value es, so the file "ES_lang.bas" will be included instead of "EN_lang.bas" which is the default in this program. #include MACRO means, MACRO can be any expression that, when resolved, leads to <XXXX> or "XXXX" RE: #include MACRO - RandomiserUsr - 2021-09-04 (2021-08-24, 08:41 AM)boriel Wrote: Include macro means you can #define MACRO <something> and later do #include MACRO so it will get replaced and do the include properly. This allows dynamically including things even from the command line. For example: Thank you ! :-) |