Information générale
Catégorie:
Codage, syntaxe et commandes
>Title: with / return
>
>I heard that having a RETURN command within a WITH-ENDWITH can cause C...5 errors. If I understand correctly, this is supposedly caused by some internal object reference which is not cleaned up.
>
Doug Hennig talked about this at GLGDW this year. IIRC he said he was getting a lot of seemingly random C5 errors and, as much in desperation as anything else, went through all his code removing every instance of a RETURN inside a WITH/ENDWITH block.... and the C5 errors went away.
>Now, before reviewing and cleaning up all my code, I have a few questions:
>
>1) Would this also apply to breaking out of a WITH-ENDWITH, with an EXIT command?
I don't know.
>
>2) How about replacing WITH with an object reference? For example, let's say I replace a long reference like ThisForm.PgfMainPageFrame.Page1.Grid1.Column3, with an object like loColumn. I suspect any references will get cleared when the variable gets out of scope, so there should be no problems. Any opinions?
I do it all the time with no problems i'm aware of.
>
>3) I am still using VFP 6 (sigh). Might this be a bug that was corrected in later versions, or does it affect all VFP versions so far?
I would imagine Doug was talking about VFP9 SP1
hth
Nigel
Précédent
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