Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return statements within the with endwith blocks
Message
De
08/01/2017 06:02:03
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
07/01/2017 17:24:59
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01646361
Message ID:
01646391
Vues:
46
>>>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 ?

I'd agree with both Steven and Sergey on this one - this is by design, and the scope of with-endwith applies to a temp private variable that holds reference to the with-endwithed object. Or else with-endwith wouldn't be as useful as it is.

I know I've used this in several methods which are intended to be called from inside a with-endwith block, i.e. they contain a lot of .ref things without the corresponding with/endwith lines, which are left to the caller. Yes, a reference could be passed as a parameter but AFAIR I had some valid reasons for doing so. And it still works flawlessly.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform