>Trying to set the DynamicBackColor in a grid to a value in a cursor.
>
>
>MyCursor.Sch_BackColor = "RGB(111,222,333)"
>
>
>Hardcoded into the formula works:
>
>
>="IIF( .T., RGB(111,222,333), 0)"
>
>
>These do not:
>
>
>="IIF( .T., Sch_BackColor, 0)"
>="IIF( .T.," + TRANSFORM(Sch_BackColor) + ", 0)"
>="IIF( .T., EVAL(Sch_BackColor), 0)"
>
>
>How do I do this? Thanks!
Is your cursor the underlying cursor of the grid, or at least related to it? Then it's much simpler than you thought. Make sure that sch_backcolor is an integer or at least long enough numeric field - n(8,0) would suffice.
replace myCursor.sch_backcolor with rgb(111,222,333)
then
dynamicbackcolor="myCursor.sch_backcolor"
no iif()s, no icases, no calculations - you have the value and it's stored in the field, so your dynamic expression is just the field. And it refreshes your grid so much faster than when you have a method call in the expression. An iif() is not so bad, speedwise, but nothing beats a simple field.