>The next bit of code is what really bugs me about WITH. If from within the with, one calls a prg/udf of whatever where one accidentally left out the object reference, even by adding a period by mistake, the ?.Name will resolve all the way back to the last WITH. That's not explicitly clear and I have seen and debugged exactly such a thing and it was tiresome to say the least. Have not used with in years, still see no value in it whatsoever. With only saves typing that can just as easily be done with copy/paste.
>
>WITH m.oForm
>?Junk()
>ENDWITH
>
>PROCEDURE junk
>?.Name
>RETURN
I've found this extremely handy in the case where I needed to do a lot of snippets on a single scatter name object, without having to pass that object as a parameter to each, and there were more of a hundred of them, working on a few thousand records, so that would be an order of magnitude of 10K function calls. Specially neat, considering that this code may be called from a few different places, where I wouldn't know the name of the object in advance (so I couldn't use it as an inherited variable), and wanted to avoid passing a parameter (as that has its cost in a tight loop like this). Works like a charm, at the cost of writing a comment wherever this is called that it must be called within a with/endwith block.
And the snippets look a lot nicer.