Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange situation - no error and not all code run
Message
 
 
À
04/02/2014 17:30:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01593215
Message ID:
01593226
Vues:
29
UPDATE. Never mind, changed the method the way it works now.


I am a bit tired now and can not figure out how to re-write this logic
	case b_sched.pref_lvl4=3 AND !empty(b_sched.whichlevel)
			lcWhichLevel = lower(alltrim(b_sched.whichlevel))
			do case
			case m.lcWhichLevel = 'tch_level' and not csrTemp.tch_level>=b_sched.tch_level
				lcReqOK = 'Booking requiring a minimum alpine level would be violated'
			case m.lcWhichLevel = 'snb_level' and not csrTemp.snb_level>=b_sched.snb_level
				lcReqOK = 'Booking requiring a minimum snowboard level would be violated'
			case m.lcWhichLevel = 'tele_level' and not csrTemp.tele_level>=b_sched.tele_level
				lcReqOK = 'Booking requiring a minimum telemark level would be violated'
			case m.lcWhichLevel = 'misc_level' and not csrTemp.misc_level>=b_sched.misc_level
				lcReqOK = 'Booking requiring a minimum other level would be violated'
			endcase	
The idea is to check many different criteria in a case statement so if I got not OK, it should not proceed with the next case.

However, in my case now that case is true, so it checks inner cases and then skips the rest of the checks that follows. I need to somehow figure out if the above is possible to rewrite differently. Should the inner case then be a new method? But then I would have to run it twice.... :(
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform