Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying DynamicForeColor in grid
Message
De
31/01/2002 23:27:50
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Displaying DynamicForeColor in grid
Divers
Thread ID:
00613829
Message ID:
00613829
Vues:
39
Hi All,


I have task to display different colors of the record in grid depending on following criteria:

* RGB(0,128,0) green
* RGB(0,0,255) blue
* RGB(255,128,0) orange
* RGB(255,255,0) red
pexp is the field name in my table

Now this is working but is not displaying RED color for the records where date of pexp is > then todays date

this.SetAll("DynamicForeColor",;
"IIF(hour(pexp)-hour(datetime())>3,RGB(0,128,0),;
iif(hour(pexp)-hour(datetime())=3, RGB(0,0,255),;
iif(hour(pexp)-hour(datetime())=2, RGB(255,128,0),;
iif(hour(pexp)-hour(datetime())<=1, RGB(255,0,0),RGB(200,0,0)))))","Column")


..so my expresion should be like

*thisform.aa = hour(datetime())

*!* WITH THISFORM
*!* this.SetAll("DynamicForeColor",;
*!* "IIF(hour(pexp)-.aa>3 and ttod(datetime())<=ttod(pexp),RGB(0,128,0),;
*!* iif(hour(pexp)-.aa=3 and and ttod(datetime())<=ttod(pexp), RGB(0,0,255),;
*!* iif(hour(pexp)-.aa=2 and ttod(datetime())<=ttod(pexp), RGB(255,128,0),;
*!* iif(hour(pexp)-.aa<=1 and ttod(datetime())<=ttod(pexp), RGB(255,0,0),RGB(200,0,0)))))","Column")
*!* ENDWITH


..but unfortunataly is longer the 255 characters.

Can anybody see another way of displaying the proper colors:
Text color criteria is:
if Expiry time >= 3 hours GREEN
if Expiry time = 3 hours BLUE
if Expiry time = 2 hours ORANGE
if Expiry time <= 1 hours RED and pexp is < todays date

Please help.

Thanks

Dejan
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform