Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Iif(mod(recno()/2)=0,rgb(),rgb()) doesn't work
Message
De
20/11/2007 14:25:29
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
20/11/2007 07:45:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01270108
Message ID:
01270257
Vues:
23
>>iif(mod(recno()/2)=0,rgb(),rgb()) this command is used to change the dynamicbackcolor of grid. but it doesn't work well on indexed vues or tables. how to correct it ?
>
>Depends. Is it possible to use a cursor? E.g.:
>
select * from thetable order by 1,2,3 into c_thecursor nofilter
The record numbers of that cursor will be fine.
>
>Here's another trick (from the head). Assume thetable has a field named ID.
>
>
select from thetable id as col_id, 00000000 as col_color into cursor c_color nofilter
>replace all col_color with iif(mod(recno(),2)=0,rgb(0,0,255),rgb(255,255,0))
>index on col_id tag primary
>select thetable
>set relation to id into c_color
>Then use c_color.col_color in the dynamicbackcolor() of the grid.

This would work perfectly, it really is a good trick. The exception to this would be repeated values of col_id, where each repeated value of that field would point to the same record in the c_color cursor, and thus show in the same color. Which is not much of trouble, IMO, but then I'm not the originator - he may have other requirements (or not have this problem at all). We'll see. I actually like this one, goes with my principle that the color should not be recalculated for each refresh.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform