hi
is it possible to enter a macro over multiple lines?
eg something like:
$macro myMacro
if (a = 1) then
do something;
else
do something else;
endif;
As I have not seen a terminating macro command I wasnt sure its
possible, but if there’s a way I would love to know.
The driver is that some of my macros are fairly big and ugly when
written on 1 line.
Thanks
Andy C
–
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
\
Andy,
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: http://www.gams.com/testlib/libhtml/macro02.htm
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.
Regards,
Michael Bussieck - GAMSWorld Coordinator
On Dec 13, 8:56 pm, AC wrote:
hi
is it possible to enter a macro over multiple lines?
eg something like:
$macro myMacro
if (a = 1) then
do something;
else
do something else;
endif;
As I have not seen a terminating macro command I wasnt sure its
possible, but if there’s a way I would love to know.
The driver is that some of my macros are fairly big and ugly when
written on 1 line.
Thanks
Andy C
–
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
\