User Tools

Site Tools


How do I enter a macro over multiple lines?

Q: Is it possible to enter a macro over multiple lines?

Eg. something like:

$macro myMacro
if (a = 1) then
 do something;
 do something else;

23.1 and later allow macro continuation characters. This is described in the release notes of 23.1 and is featured in the testlib model macro02.

While you can do a lot with macros, the intent was to have a compact representation of (recursively defined) expressions. Your example uses it for multiple statements. Be aware of macro expansion and compile time statements.

IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/enter_a_macro_over_multiple_lines.txt · Last modified: 2009/12/14 10:07 by support