>>Hope this partial code helps :
LPARAMETERS nColIndex
>>[snip]
>> if !empty(.columns(nColIndex).dynamiccurrentcontrol)
>> cCurrentControl = eval(.columns(nColIndex).dynamiccurrentcontrol)
>> else
>> cCurrentControl = .columns(nColIndex).currentcontrol
>> endif
>
>Very helpful, thank you (of course it does more than I was trying to). The only thing I don't understand is why you're using EVAL() on dynamiccurrentcontrol. Doesn't it contain a string, the name of the current control, just like currentcontrol does? Why EVAL() one and not the other?
>
>Thanks,
>Rich.
Rich,
You're right it doesn't encapsulate all possibilities and make assumption that currentcontrol and dynamiccurrentcontrol would be used for purpose always. They are different.
Dynamiccurrentcontrol is a string containing an expression for the sake of "dynamic" like :
...dynamicccurentcontrol = [iif(Something, "somecontrol", "someothercontrol")]
or it could just be a function :
...dynamicccurentcontrol = [getmycontrol()]
In both cases I have to evaluate() it to get the controlname.
You could directly put say "Edit1" (or place "=" in front of expression) there but I take it nonsense for "dynamic" is killed and simply writing currentcontrol in a different way :) I was lazy to errorcheck making this assumption.
In fact I believe few ppl use DynamicCurrentControl and know what they do :)
OTOH currentcontrol might be an expression but evaluated already and keeps the controlling control as string where (generally) currentcontrol = "somecontrol".
or :
currentcontrol = "=getmycontrol()" && Evaluator operator
Cetin