Magentix
if (OP.statement == false) postCount++;
- Reaction score
- 107
Suppose this: I want a user to be able to create a set of structs with a textmacro. But inside the struct, there's a ton of functions that could use textmacroing as well.
Ergo: Nesting textmacroes would be the obvious solution, too bad it isn't allowed, though...
Example:
Would look so much better as:
Could this be possible in NewGen?
Ergo: Nesting textmacroes would be the obvious solution, too bad it isn't allowed, though...
Example:
JASS:
//! textmacro StructCreate takes NAME
struct $NAME$
integer i
real r
string s
unit u
// Etc...
method setinteger takes integer val returns nothing
set .i = val
endmethod
method setreal takes real val returns nothing
set .r = val
endmethod
method setstring takes string val returns nothing
set .s = val
endmethod
method setunit takes unit val returns nothing
set .u = val
endmethod
// Etc...
endstruct
//! endtextmacro
//! runtextmacro StructCreate("S1")
//! runtextmacro StructCreate("S2")
//! runtextmacro StructCreate("S3")
//! runtextmacro StructCreate("S4")
Would look so much better as:
JASS:
//! textmacro Methods takes TYPE, VARNAME
method set$TYPE$ takes $TYPE$ val returns nothing
set .$VARNAME$ = val
endmethod
//! endtextmacro
//! textmacro StructCreate takes NAME
struct $NAME$
integer i
real r
string s
unit u
// Etc...
//! runtextmacro Methods("integer","i")
//! runtextmacro Methods("real","ri")
//! runtextmacro Methods("string","s")
//! runtextmacro Methods("unit","u")
// Etc...
endstruct
//! endtextmacro
//! runtextmacro StructCreate("S1")
//! runtextmacro StructCreate("S2")
//! runtextmacro StructCreate("S3")
//! runtextmacro StructCreate("S4")
Could this be possible in NewGen?