Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Colors on a grid
Message
De
10/02/2017 14:32:15
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/02/2017 14:18:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01647843
Message ID:
01647845
Vues:
60
>Hello all.
>
>I have code that will change the color of a row in a grid, depending on certain conditions, on our legacy system written VFP8.
>
>Generally speakings, how much of a performance hit is it to run this code for about 500 rows on a grid?

You can't show 500 rows, you'd need at least 9500 pixels vertically.

You're probably showing no more than 20-30 of them, so refreshing each visible cell takes what it takes. The expression used is evaluate()d for each dynamic property that you have set, for each refresh of the grid, that's it.

It's been a while since I last saw it affect performance, unless the debugger is open - then you go find some coffee or lose the nerves or both. Now it also depends on the complexity of the expression - a simple iif(...) will go fast, an icase() somewhat slower, a function or method call may make it noticeable. If you do need some serious code to calculate a dynamic property, well then have it calculated once and store the value you get into extra (invisible, i.e. columnless) fields of your cursor. If the value may change, well, recalculate and store again. Your dynamic property expression is then just the name of the field, no calculation at all, and it's blazingly fast (tested 17 years ago on a 200MHz machine in VFP6, was fast even then).

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
Répondre
Fil
Voir

Click here to load this message in the networking platform