Information générale
Catégorie:
Codage, syntaxe et commandes
I didn't think this would work:
WITH oMyObj
.SomeProperty=.T.
SomeFunction()
.AnotherProperty=.F.
ENDWITH
* ...more code in this procedure
Function SomeFunction()
.YetAnotherProperty=.T.
Return
If .YetAnotherProperty is a property of oMyObj in the calling code,
this will resolve OK in the function SomeFunction.
But I thought that WITH / ENDWITH only scoped to the current procedure. What's up?
WITH / ENDWITH use a scoped rule like a private variable within the WITH / ENDWITH block:
until it is not redefine, the with object is visible into the calls stack
Fabio
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement