... could be a nice thing to make code easier to read. (especially for INLINE snippets)
MACRO newcommand(var)
INLINE
var++;
...
ENDINLINE
ENDMACRO
// use in GLBasic code
LOCAL counter%
newcommand(counter)
FUNCTION can do the same...
EDIT:
LOCAL my_var = 10
Add(my_var)
WHILE TRUE
PRINT my_var,10,10
SHOWSCREEN
WEND
END
FUNCTION Add: BYREF var
INLINE
var++;
ENDINLINE
ENDFUNCTION
sure, but FUNCTION always does have overhead (calling, stack, ...)
Macro is a simple replacement of code, so produces bigger, but faster code.
macros are not type safe. I would have to run a pre-pre-compiler for the macros. A nice idea, though.
What about platform specific macros? That way you could do something like
if for iphone
resolution = 100x200
else
resolution = 800x600
endif