Code: Select all
vParam = 'pnDebug';
vtest = IF(SUBST(vParam, 2, 1) @= 'S', 1, 0);
vN = CellGetN(cubProcessControl, sProcess, '0', 'ParamNValue');
vS = CellGetS(cubProcessControl, sProcess, '0', 'ParamSValue');
# v3 is not declared until here
IF(vTest = 0);
v3 = vN;
ENDIF;
IF(vTest = 1);
v3 = vS;
ENDIF;
# this complains as well:
IF(vTest = 0);
v3 = vN;
ELSE;
v3 = vS;
ENDIF;
So no such thing, apparently, as conditional variable declarations in a TI. As you might surmise, I'm trying to pseudo dynamically pass parameters to a sub-process based on cube values for ExecuteProcess or RunProcess. This is not a problem with TM1RunTI as the execution string can be built as needed.
Guess I've just never run into this before. Any suggestions for accomplishing what I'm trying to do? I can work around it by modifying the sub-processes. May test reading a cubeview and using SValue/NValue.