User Tools

Site Tools


gams:enter_a_macro_over_multiple_lines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gams:enter_a_macro_over_multiple_lines [2009/12/14 10:07] (current)
support created
Line 1: Line 1:
 +====== How do I enter a macro over multiple lines? ======
 +Q: Is it possible to enter a macro over multiple lines?
 +
 +Eg. something like:
 +<​code>​
 +$macro myMacro
 +if (a = 1) then
 + do something;
 +else
 + do something else;
 +endif;
 +</​code>​
 +
 +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
 +[[http://​www.gams.com/​testlib/​libhtml/​macro02.htm|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