>>Hi,
>>Just pass the field to the function, VFP will evaluate runtime
>>
>>What error message you get?
>
>John,
>
>In the Function, your CASE statements refer only to FIXED values "0001" and "0002" for UPSINO. UPSINO is the ID number for a piece of equipment. It could have a value of any string up to seven characters. So I can have a UPSINO that looks like "TC00001" "TC0002" , or even "LTC00045", "LTC00046", etc. And in the resulting cursor, there will be multiple lines for any one of these UPSINOs. So I want to alternate like "green bar" paper, but not by every other row, rather alternate when the UPSINO changes each time in the resulting grid.
>
>In the function you describe, it looks like you want me to make a CASE statement for every possibility of UPSINO.
>
>Am I totally missing it or what?
OK, then here's a better one: add one integer field to your cursor and let's name it nColor. For each group you can assign it a RGB number of your choice. You can alternate two colors, or n colors - whatever you like.
Something like this:
n=0
dimension aColors[4]
aColors[1]=0xFFFFFF
aColors[2]=0x00FFFF
aColors[3]=0xE2E2E2
aColors[4]=0xFF7fFF
set order to upsino
locate
do while !eof()
n=n+1
if n>4
n=1
endif
c=upsino
replace nColor with aColors[n] while c=upsino
enddo
Then have
.dynamicbackcolor="ncolor"
...and there you are. No expressions to evaluate, no functions to call.