Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gridhighlighter Colors
Message
 
 
À
08/09/2005 13:41:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01047761
Message ID:
01047820
Vues:
14
Fabio,

>AND NOT HARD CODED !!!

Sorry but your posted code is extremely hard coded!

Only 3 statuses allowed because of the array, hard coded color values put into the array, constrained to status values >= 'A', error causing if status D is added to the system at a later point.

Cetin' and John's method based approaches are far more robust.

Not hard coded means that it's entirely driven by data stored in a place and used in a fashion that doesn't require recompilation for the change to appear within the application.

>another way ( rigid ( ABCDE... only ) but faster.
>
>* grid Init
>this.addproperty("statusColor[3]")
>this.statusColor[1] = 0xFF0000
>this.statusColor[2] = 0x00FF00
>this.statusColor[3] = 0x0000FF
>
>this.Setall('DynamicBackColor';
>,'this.statusColor[ASC(manifest.status)-64]')
>
>
>extreme rigid but faster:
>
>this.Setall('DynamicBackColor';
>,'BITLSHIFT(255,8*(ASC(manifest.status)-65])')
>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform