Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CASE permutations
Message
From
07/09/2007 22:33:16
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
CASE permutations
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01253160
Message ID:
01253160
Views:
68
I'm sure there is a better way to handle the CASE for the two parameters in the code below. How can I make this block extensible so I can add other message and cursor types in the future without ending up with a spaghetti bowl of code?
	PROCEDURE GetCursor

		PARAMETERS MessageType, CursorType

		DODEFAULT()

		DO CASE
			CASE m.MessageType = 'HL7' AND CursorType = "Demographics"
				* Do Something 
			CASE m.MessageType = 'HL7' AND CursorType = "Scheduler"
				* Do Something 
			CASE m.MessageType = 'EDI' AND CursorType = "Demographics"
				* Do Something 
			CASE m.MessageType = 'EDI' AND CursorType = "Scheduler"
				* Do Something 
		ENDCASE

	ENDPROC
Next
Reply
Map
View

Click here to load this message in the networking platform