I came across a strange behavior. What exactly is the difference between defining a macro one line (with ":") and in mutilple lines?
Is it even allowed to define a macro in one line?
Example:
Code: Select all
Macro DoubleQuote
"
EndMacro
Macro Test1(x):Debug DoubleQuote#x#DoubleQuote:EndMacro
Macro Test2(x)
Debug DoubleQuote#x#DoubleQuote
EndMacro
Test1(Apple)
Test2(Banana)
The Test1 and Test2 are the same macros, just written diffently, one could think.
But only the Test2 macro behaves as expected, the Test1 macro outputs just "x", the parameter is not expanded.
Can someone explain this? Feature (unknown to me) or bug?
BTW: The DoubleQuote feels like a hack. It would be better to have a special character as prefix or postfix to the parameter name and the macro processor would automatically stringify it, like in this example Debug x$ or $x or #x or ##x or whatever. But I don't think this exists, right?