Oxygen Basic
Programming => Example Code => General => Topic started by: Charles Pegge on February 04, 2015, 01:20:29 PM
-
A very simple idea: the macro clones itself for every parameter passed.
macro mi(...)
printl ...
end macro
mi 1,2,3,4,5,6,7
result:
1
2
3
4
5
6
7
Oxygen Update
http://www.oxygenbasic.org/o2zips/Oxygen.zip
-
Another concept to allow macros to process optional parameters:
#ifexist
#ifnexist
includepath "$/inc/"
include "console.inc"
macro mo(a,b,c,d)
=================
#ifexist a
printl a
#endif
#ifexist b
printl b
#endif
#ifexist c
printl c
#endif
#ifexist d
printl d
#endif
printl "ok"
end macro
macro mi(...)
=============
printl ...
end macro
mo 1,2,3,4,5,6,7
/*
restult:
1
2
3
4
ok
*/
mi 1,2,3,4,5,6,7
/*
restult:
1
2
3
4
5
6
7
*/
waitkey