Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Johnny Quest
  Where is Johnny Quest?
 Ocala
 Florida - United States
 Johnny Quest
 To: Gene Wirchenko
  Where is Gene Wirchenko?
 Kamloops
 Canada
 Gene Wirchenko
 Tags
Subject: RE: my CASE or ICASE won't work VFP9
Thread ID: 416528 Message ID: 416537 # Views: 35 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Tuesday, December 30, 2014 9:05:43 PM         
   


> > I try to put CASE or ICASE in my forms and they won't work.
>
> > Examples:
> >
>
> > ***   THIS CODE WORKS IN MY GRID's INIT()
> > Thisform.pgfrm.Page1.grid1.SetAll("DynamicBackColor", ;
> >   "IIF(catorder=[CX], RGB(0,255,64), ;
> >    IIF(catorder=[IN], RGB(0,255,255),;
> >    IIF(catorder=[PP], RGB(255,128,128),;
> >     RGB(255,255,255))))","Column")  
> 
> > ***  THIS CODE WILL NOT WORK IN MY GRID's INIT()
> > Thisform.pgfrm.Page1.grid1.SetAll("DynamicBackColor", ;
> >     [ICASE(catorder=[CX], RGB(0,255,64), ;
> >            catorder=[IN], RGB(0,255,255),;
> >            catorder=[PP], RGB(255,128,128),;
> >            otherwise RGB(255,255,255))])  
>              ^^^^^^^^^
> 

> Get rid of the "otherwise".
>
> > I do NOT get errors but it won't work.
> >
> > I even broke it down to using a procedure.
> >
>
> > ***  THIS CODE WILL NOT WORK
> > Procedure gridColors
> > 
> > do case
> >    case catorder=[CX]
> >     return RGB(0,255,64)
> >    case catorder=[IN]
> >     return RGB(0,255,255)
> >    case catorder=[PP]
> >     return RGB(255,128,128)
> >    otherwise
> >     return RGB(255,255,255)
> > endcase
> 

> Missing "endproc"?
>
>
> > ** this line in grid INIT()
> > Thisform.pgfrm.Page1.grid1.column1.DynamicBackColor = "gridColors()"
> 

> Is gridColors() in scope when the grid is active? If gridColors() is a method, you need an object reference in front of it. e.g. thisform.gridColors().
>
> > So the question here is Why will my "CASE or ICASE" don't work.
> >
> > NOTE BEFORE YOU ANSWER: If I change the CASE and ICASE to IF statements, then everything works fine.
>
> Sincerely,
>
> Gene Wirchenko


YES! It is in scope. I have procedures set to its main file. I changed the Procedure to Function as Bleken described but still won't work
with CASE nor ICASE... something not right.. I do have it working with IFs or IIFs, but not case or icase.

Just started this strange behavior.. don't understand it.. I did a fresh install too and still the same problem...


Dr. Quest

ENTIRE THREAD

my CASE or ICASE won't work VFP9 Posted by Johnny Quest @ 12/30/2014 8:12:21 PM
RE: my CASE or ICASE won't work VFP9 Posted by Tore Bleken @ 12/30/2014 8:26:50 PM
RE: my CASE or ICASE won't work VFP9 Posted by Johnny Quest @ 12/30/2014 9:02:34 PM
RE: my CASE or ICASE won't work VFP9 Posted by Tore Bleken @ 12/30/2014 9:19:10 PM
RE: my CASE or ICASE won't work VFP9 Posted by Mike Yearwood @ 12/30/2014 9:41:04 PM
RE: my CASE or ICASE won't work VFP9 Posted by Jun Tangunan @ 12/30/2014 10:03:04 PM
RE: my CASE or ICASE won't work VFP9 Posted by Gene Wirchenko @ 12/30/2014 8:34:16 PM
RE: my CASE or ICASE won't work VFP9 Posted by Johnny Quest @ 12/30/2014 9:05:43 PM
RE: my CASE or ICASE won't work VFP9 Posted by Tore Bleken @ 12/31/2014 10:53:16 AM
RE: my CASE or ICASE won't work VFP9 Posted by Chuanbing Chen @ 12/31/2014 12:11:31 PM