Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: ursula
  Where is ursula?
 Jakarta
 Indonesia
 ursula
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: DynamicBackColor >255
Thread ID: 289028 Message ID: 289039 # Views: 41 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Tuesday, December 28, 2010 5:10:02 AM         
   


Thanks all for the advice,

Beside that method, I also found out another way as follow:

TEXT to vn noshow
	IIF(TRIM(tmpLpsd.notes)='YELLOW',RGB(247,247,171),IIF(TRIM(tmpLpsd.notes)='BLUE',RGB(214,216,250),IIF(TRIM(tmpLpsd.notes)='GREEN',RGB(214,250,214),IIF(TRIM(tmpLpsd.notes)='RED',RGB(255,224,193),IIF(TRIM(tmpLpsd.notes)='BROWN',RGB(207,159,111),THIS.Column1.BackColor)))))
ENDTEXT
thisform.grdlcsrch.SetAll("DynamicBackColor", vn, "Column")


Cheers
ursula

> > Hi all,
> >
> > I got an error saying "unrecoqnized command verb" when I use this syntax below. I notice that actually because the syntax is more than 255 char. Please advise how should I do.
> >
> >
Thisform.grdlcsrch.SetAll("DynamicBackColor", ;
> >     "IIF(TRIM(tmpLpsd.notes)='YELLOW',RGB(247,247,171),IIF(TRIM(tmpLpsd.notes)='BLUE',RGB(214,216,250),IIF(TRIM(tmpLpsd.notes)='GREEN',;
> >     RGB(214,250,214),IIF(TRIM(tmpLpsd.notes)='RED',RGB(255,224,193),IIF(TRIM(tmpLpsd.notes)='BROWN',RGB(207,159,111),THIS.Column1.BackColor)))))", "Column")

> >
> > Thanks
> > Ursula
>
> Yes that is one reason. Since you are using VFP9, use ICASE() instead of IIF(). To make it readable, use semicolons. Also, you can remove the table name:
>
> This.Grid1.SetAll("DynamicBackColor", ;
>     "ICASE(TRIM(notes)='YELLOW',RGB(247,247,171),;
>     TRIM(notes)='BLUE',RGB(214,216,250),;
>     TRIM(notes)='GREEN', RGB(214,250,214),;
>     TRIM(notes)='RED',RGB(255,224,193),;
>     TRIM(notes) = 'BROWN',RGB(207,159,111),;
>     RGB(255,255,255))","Column")

>
> Further, since you are using RGB() in the IIF(), you cannot use Column1.BackColor because it returns a numeric representation of RGB(). To avoid it, use RGB() likewise on the OTHERWISE portion of ICASE() as shown above.
>
>
> http://www.junblogs.com/
> http://weblogs.foxite.com/sandstorm36/default.aspx
> http://www.coderisland.com/forum/viewforum.php?f=10

ENTIRE THREAD

DynamicBackColor >255 Posted by ursula @ 12/28/2010 3:38:08 AM
RE: DynamicBackColor >255 Posted by Samir H. @ 12/28/2010 3:49:01 AM
RE: DynamicBackColor >255 Posted by Jun Tangunan @ 12/28/2010 4:38:12 AM
RE: DynamicBackColor >255 Posted by Samir H. @ 12/28/2010 5:05:37 AM
RE: DynamicBackColor >255 Posted by Jun Tangunan @ 12/28/2010 5:20:49 AM
RE: DynamicBackColor >255 Posted by ursula @ 12/28/2010 5:10:02 AM
RE: DynamicBackColor >255 Posted by Cetin Basoz @ 12/28/2010 12:11:13 PM