>>
>>this.setall("DynamicBackColor",;
>> "iif(ascan(thisform.aOrder,"+;
>> "recno())%2=0,"+tran(rgb(0,255,0))+;
>> ","+tran(rgb(255,255,0))+")","Column")
>>This way there's two function calls (even if it's such a simple function as rgb() in the expression.
>>In the framework we use there was a method call in the dynamicbackcolor expression; the method was just a five-liner, if [expression] - return this.backcolor - else - return thisform.backcolor - endif. Just replacing the method call with an iif() expression containing constants sped it up incredibly. The difference was really visible in the debugger, it was like "oh no it's refreshing again, lemme get some coffee until it finishes" compared to "ok, one, two, here it is".
>
>Good Dragan,
>Then you could also make it shorter and increase support count to 65000*2 recs for an array.
>
>-First select into a cursor
>-Select only odds or evens into array
>-Change expression to something like :
>
'(ascan(recno())*'+tran(myColor1-myColor2)+tran(myColor1)+')'
>No iif() too :)
>Say I put only odd ones in array and oddcolor=120000, evencolor=100000
>(ascan(recno())*20000+(100000)
>Cetin
Of course, the best you can do is influence the process of creating the cursor in the first place, and add an integer column with actual color number. Then there's no iif, noarrays and no function at all, and you can use all the colors you like:
>
'tran(myColorField)'
>No iif() too :)
Nothing at all :)