Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange situation - no error and not all code run
Message
 
 
To
04/02/2014 17:22:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01593215
Message ID:
01593221
Views:
35
I figured this out.

In VFP case expression it works this way:
IF OneCondition IS TRUE
    do the code here

and don't process other case statements.
I completely forgot and this took a lot of my time before I finally understood it.



>>This is exactly my point - I am trying to trace in the Debugger. As soon as I hit this line
>>
>>case b_sched.pref_lvl11 = 3  && true
>>	   =MESSAGEBOX(b_sched.base_id)
>>	   =MESSAGEBOX( seek(b_sched.base_id, 'csrTemp1', 'base_id'))
>>	    
>>	    if not seek(b_sched.base_id, 'csrTemp1', 'base_id')
>>			lcReqOK = 'Booking requiring specific instructor base would be violated'
>>        endif
>>
>>the cursor immediately goes to the endcase line. Why it doesn't even attempt to get me my messageboxes I added out of the desperation?
>>
>>I don't think the coverage will provide any more insights here. I even started to wonder if I understand how case works in VFP. I have a condition which is true. Why no code inside the case statement is executed?
>
>Have you set watches or otherwise 1,000% confirmed all variables have the values you expect?
>
>You could try adding an OTHERWISE clause to see if it gets hit, maybe what you think is .T. is not.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform