Macro-processor conditionals with loops
Posted: Sat Dec 31, 2011 9:46 pm
I'm trying to simulate a multi-sector model with search frictions and running into problems with the macro preprocessor when I try to create an integer value for a conditional test using loop indices. Code like this:
Gives me the error
Should this operation be kosher, or does it make sense that I'd have trouble?
In the attached code, the problem first occurs on line 66, though I use a similar test elsewhere and get the same error.
Thanks very much,
David
- Code: Select all
@#for l in 0:JJ
@#for j in 1:JJ
@#if (@{l} == @{j} || @{l}==0)
Equation
@#else
Equation
@#endif
@#endfor
@#endfor
Gives me the error
ERROR in macro-processor: occbc.mod:66.9: Macro lexer error: '@'
Should this operation be kosher, or does it make sense that I'd have trouble?
In the attached code, the problem first occurs on line 66, though I use a similar test elsewhere and get the same error.
Thanks very much,
David