Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search Conditions
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00810105
Message ID:
00810110
Views:
12
Thanks Caroline,

I decided to use variables in a case statements:
LOCAL lcwhere1, lcwhere2, lcwhere3
SET EXCLUSIVE OFF
SET DELETED ON

lcwhere1="modacad.key3=thisform.combo1.displayvalue"
lcwhere2="modacad.key3==thisform.combo1.displayvalue"
lcwhere3="modacad.key3$thisform.combo1.displayvalue"

DO CASE 
	CASE 1
		IF thisform.combo1.displayvalue='='
			SELECT * ;
			FROM ("U:\Data\modacad.dbf") ;
			WHERE lcwhere1 ;
			order BY mainkey ;
			INTO CURSOR crssearch
		ENDIF
	CASE 2
		IF thisform.combo1.displayvalue='=='
			SELECT * ;
			FROM ("U:\Data\modacad.dbf") ;
			WHERE lcwhere2 ;
			order BY mainkey ;
			INTO CURSOR crssearch
		ENDIF
	CASE 3
		IF thisform.combo1.displayvalue='$'
			SELECT * ;
			FROM ("U:\Data\modacad.dbf") ;
			WHERE lcwhere3 ;
			order BY mainkey ;
			INTO CURSOR crssearch
		ENDIF

ENDCASE
I get a syntax error. Do you have any ideas as to why this doesn't work?

Thanks Caroline
Neil Lewis
IT R&D Manager
Velmore Ltd
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform