Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return statements within the with endwith blocks
Message
From
07/01/2017 17:24:59
 
 
To
07/01/2017 06:19:44
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01646361
Message ID:
01646387
Views:
58
This message has been marked as a message which has helped to the initial question of the thread.
>>Hi everybody,
>>
>>I recall there were some issues of using return statements within with /endwith blocks. Can you point me out to some related blogs and is it still considered a bad practice to use them?
>>
>>Can they lead to VFP9 crashes (especially since there is ActiveX involved)?
>
>Personally witnessed a returning local var changing datatype in calling function when issued from within with..endwith.
>Uncertain if it was with vfp6 or vfp8 libs.
>After that having only single return statement was given higher priority and a simple code scanner to find returns inside with was written, run directly after next release with manual fixes.

Maybe related to this: http://fox.wikis.com/wc.dll?Wiki~WithLeaksLocals ?

>With.. Endwith changed to local temp references whenever I encounter it, as shortened object resolution can be beneficial for perf: get managment approval in advance and schedule such sessions directly for work start or after extended breaks.
>
>Side benefit is code easier to read by having a well named temp reference instead of a dot for which the origin might be 2 screens above.

Agreed.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform