Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: DynamicBackColor >255
Thread ID: 289028 Message ID: 289038 # Views: 45 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Tuesday, December 28, 2010 5:05:37 AM         
   


> > 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.


"...you cannot use Column1.BackColor..."
Why not? They all return numeric values, column1.backcolor as well as rgb().


>
>
> http://www.junblogs.com/
> http://weblogs.foxite.com/sandstorm36/default.aspx
> http://www.coderisland.com/forum/viewforum.php?f=10



Regards
Samir

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