icase question

This forum is meant for questions about the Visual FoxPro Language support in X#.

Post Reply
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

icase question

Post by kevclark64 »

Do conditions used in ICASE need to have parentheses around them? It seems like they do, but I wonder if I'm just doing something wrong.

Code: Select all

lcdiplomatype=ICASE((eid_retval="G"),"General",(eid_retval="A"),"Advanced",(eid_retval="N"),"Non-Diploma","Standard")  //no error
lcdiplomatype=ICASE(eid_retval="G","General",eid_retval="A","Advanced",eid_retval="N","Non-Diploma","Standard")  //compiler error XS1739
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

icase question

Post by Karl-Heinz »

Hi Kevin,

i tried this, and it works as expected. /Fox2 enabled or disabled makes no difference.

regards
Karl-Heinz

Code: Select all

FUNCTION Start() AS VOID
PRIVATE eid_retval 
PRIVATE lcdiplomatype
	          
	eid_retval = "A"
	
	lcdiplomatype=ICASE(eid_retval="G","General",eid_retval="A","Advanced",eid_retval="N","Non-Diploma","Standard") 
    
	? lcdiplomatype   && "Advanced" 
	
	RETURN
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

icase question

Post by kevclark64 »

You're right, ICASE doesn't give an error in a new program. Maybe what I'm seeing is a cascade from other errors.
Post Reply