Hi David,
This is right, but not in all situations. The nested IIF in DynamicBackColor property works faster than such procedure call from the same DynamicBackColor property, which is especially important for the class like GridHighlighter.
However, I always recommend to add such procedure call for certain column.DynamicBackColor in GridHighlighter.OnPostSetDynamicColors method when people ask me how they can highlight also individual cells according to their value in addition to the record highlighting.
>Nick,
>
>Which why complex code should be coded as a simple call to a method, that can use whatever language constructs it needs to make the code maintainable. I had a grid that needed the backcolor or a column to be one of several colors to match the multipart color coded ticket. The BackColor property was just set to:
>
>
thisform.StageColor( recno( "stackstages" ) )
>
>and the method looked like:
>
>
>* they match the colors of the pages from the stack ticket
>
>lparameter pnRecno
>
>do case
> case ( pnRecno = 1 )
> return rgb( 255, 255, 255 )
> case ( pnRecno = 2 )
> return rgb( 255, 255, 0 )
> case ( pnRecno = 3 )
> return rgb( 255, 128, 255 )
> case ( pnRecno = 4 )
> return rgb( 255, 128, 0 )
> case ( pnRecno = 5 )
> return rgb( 255, 255, 164 )
> otherwise
> return rgb( 192, 192, 192 )
>endcase
>
>That's far better solution than 6 nested IIF()s.
>
>>For example, considering GridHighlighter features, you might imagine the complexity of the final IIF which is stored to Dynamic... properties. You (me :)just cannot work with the expression of that kind in one line.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison