No variable defined outside of the new column message should be used inside the new column() message.
In my company we have an automatic check that detects such programming issues before executing the code.
If a potential error is detected, a warning message is presented to the user with some suggestions.
Re: Expression Handling in JMP: Tipps and Trapdoors
For( i = 1, i <= 8, i++,
col = 11 + i;
l = col - i;
m = col + 1 - i;
colno = Char( col );
Eval(Eval Expr(New Column( "Column " || colno,
Character,
"Nominal",
Formula(
If( Row() == 12,
Lag( Column( 1 ), Expr(l) ),
If( Row() == 13,
Lag( Column( 2 ), Expr(m) ),
Lag( Expr(Name Expr(As Column( col))), 1 )
)
)
)))
);
);
ouch! As column doesn't understand numbers ...