Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp7err.log
Message
From
15/10/2018 06:18:13
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 7
Network:
Windows Server 2016
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01662529
Message ID:
01662590
Views:
41
>>>Hi Martina,
>>>
>>>What is the "WITH .RETURN.. ENDWITH bug"???
>>
>>IIRC, it's that you should not just jump out of a with/endwith block - so no return, loop or exit statements, because with/endwith seems to stay in effect, having not reached the endwith statement. So the "with stack" (for lack of better term) remains in unresolved, or active, state, is not automatically reset. Don't remember what ill effects it may have, but I do remember that I went through all of my code when it was discovered and checked for this. Found a couple.
>
>Thanks for this info, Dragan.
>
>Our software has a lot of places with such code. I have never noticed any negative effects.
>
>Is there any search-word I can use to find additional info? Does anyone else know more details?

I found this article of Doug: http://doughennig.blogspot.com/2006/04/dont-return-inside-with.html

Many years ago I also got those errors from return in With/Endwith, but it is not always reproducable.

Now I follow a rule to have only one exit point in a method (unless the return is just at the beginning based on the situation). Besides the possible errors, it is very difficult to read code if there are multiple exit locations. Best is to have one return variable and evaluate expressions instead of just return inside the method.

Also I find with/endwith overrated, it does not make the code more clear, and also does not really save that much time.
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform