No, I think the called method, if it uses WITH/ENDWITH, it would be OK.
WITH/ENDWITH seems to be stack oriented even across calling levels, but
where you are in the stack may not be what you expect for anything outside
of a defined WITH/ENDWITH in the called method.
_screen.addobject("oz","grid")
_screen.oz.Visible = .t.
WITH _screen.oz
test() && level 1 in stack
WITH .Columns(1)
test() && level 2 in stack
WNDWITH
ENDWITH
RETURN
FUNCTION test
.left = 250 && who knows what level this is??? Or what the object
reference might be (in this example, the second call would fail as a Column
does not have a .Left property)
WITH somenewobject
* code here is on it's own WITH level added to the stack
* from the first call, this would be level 2 in the stack
* from the second call this would be level 3 in the stack
* No harm as long as we don't care about anything outside of this
WITH/ENDWITH block
ENDWITH
RETURN
Fred
On Wed, May 10, 2017 at 3:17 PM, Gene Wirchenko <[email protected]> wrote:
> At 14:27 2017-05-10, Fred Taylor <[email protected]> wrote:
>
>> It actually runs. Scary, huh!
>>
>
> Very.
>
> It means that a WITH block has execution scope, not lexical scope.
>
> It might be why some people have trouble with WITH.
>
> Suppose a caller has one or more WITH blocks open and calls a
> method. If the called method uses WITH, the object references are not
> going to be what is expected. There is nothing the called method can do
> about it and still use WITH.
>
> [snip]
>
> Sincerely,
>
> Gene Wirchenko
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/cajcbksq1fg5rx5s1fanys2n+oqnpqo1upgw0yr5ek3yyu5p...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.