I came across some odd behavior today, and would appreciate feedback
on this. To demonstrate the issue, create two files:

File 1: zoot.prg

Procedure zoot
=zoot1()
set procedure to
=zoot1a()
return

File 2: zoot1.prg

PROCEDURE zoot1
WAIT WIND `ZOOT1' TIME 1
RETURN
PROCEDURE ZOOT1A
WAIT WIND `ZOOT1A' TIME 1
RETURN

Then in the command windows, DO ZOOT. It does the zoot1 wait window as
expected. Surprisingly, it also does the zoot1a wait window. Why? I
added the SET PROCEDURE TO line to clear any open procedure files,
thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1, but it
still works. CLEAR PROGRAM stops it from working. Is this an undocumented
feature? I was not aware that DOing a PRG file would load make all
procedures in the PRG available, even after the top level procedure was
exited, and therefore no longer in the call stack.

We also discovered that suspending VFP would clear it from memory, as if VFP
arbitrarily clears such stuff when it wants to or thinks it needs to.

Re: finding procedures in a procedure file by Imaginecorp

Imaginecorp
Wed May 31 21:40:37 CDT 2006

Its been there since 2.5... Think about it. when a program is executed its
stored in memory. Clear program clears it form memory, Suspend takes the
program out of memory and executes line by line storing each in memory.
Set procedure To is not meant to be in a program but is an external
directive.
Mohammed


"Ook" <nousenetspam@zootal.nospam.com> wrote in message
news:%234S0d3RhGHA.3996@TK2MSFTNGP03.phx.gbl...
>I came across some odd behavior today, and would appreciate feedback
> on this. To demonstrate the issue, create two files:
>
> File 1: zoot.prg
>
> Procedure zoot
> =zoot1()
> set procedure to
> =zoot1a()
> return
>
> File 2: zoot1.prg
>
> PROCEDURE zoot1
> WAIT WIND `ZOOT1' TIME 1
> RETURN
> PROCEDURE ZOOT1A
> WAIT WIND `ZOOT1A' TIME 1
> RETURN
>
> Then in the command windows, DO ZOOT. It does the zoot1 wait window as
> expected. Surprisingly, it also does the zoot1a wait window. Why? I
> added the SET PROCEDURE TO line to clear any open procedure files,
> thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1, but it
> still works. CLEAR PROGRAM stops it from working. Is this an undocumented
> feature? I was not aware that DOing a PRG file would load make all
> procedures in the PRG available, even after the top level procedure was
> exited, and therefore no longer in the call stack.
>
> We also discovered that suspending VFP would clear it from memory, as if
> VFP arbitrarily clears such stuff when it wants to or thinks it needs to.
>
>
>



Re: finding procedures in a procedure file by Ook

Ook
Wed May 31 22:16:54 CDT 2006

Are you sure? I tested it with FPD2.6 and it did not exhibit this behavior.

"Imaginecorp" <imaginecorp@msn.com> wrote in message
news:uhZ1ETShGHA.4276@TK2MSFTNGP03.phx.gbl...
> Its been there since 2.5... Think about it. when a program is executed its
> stored in memory. Clear program clears it form memory, Suspend takes the
> program out of memory and executes line by line storing each in memory.
> Set procedure To is not meant to be in a program but is an external
> directive.
> Mohammed
>
>
> "Ook" <nousenetspam@zootal.nospam.com> wrote in message
> news:%234S0d3RhGHA.3996@TK2MSFTNGP03.phx.gbl...
>>I came across some odd behavior today, and would appreciate feedback
>> on this. To demonstrate the issue, create two files:
>>
>> File 1: zoot.prg
>>
>> Procedure zoot
>> =zoot1()
>> set procedure to
>> =zoot1a()
>> return
>>
>> File 2: zoot1.prg
>>
>> PROCEDURE zoot1
>> WAIT WIND `ZOOT1' TIME 1
>> RETURN
>> PROCEDURE ZOOT1A
>> WAIT WIND `ZOOT1A' TIME 1
>> RETURN
>>
>> Then in the command windows, DO ZOOT. It does the zoot1 wait window as
>> expected. Surprisingly, it also does the zoot1a wait window. Why? I
>> added the SET PROCEDURE TO line to clear any open procedure files,
>> thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1, but it
>> still works. CLEAR PROGRAM stops it from working. Is this an undocumented
>> feature? I was not aware that DOing a PRG file would load make all
>> procedures in the PRG available, even after the top level procedure was
>> exited, and therefore no longer in the call stack.
>>
>> We also discovered that suspending VFP would clear it from memory, as if
>> VFP arbitrarily clears such stuff when it wants to or thinks it needs to.
>>
>>
>>
>
>



Re: finding procedures in a procedure file by Leonid

Leonid
Thu Jun 01 09:19:43 CDT 2006

There are some more similar "features"

zoot.prg

do zoot1
do zoot1 in zoot1

zoot1.prg

wait window "zoot1_1" timeout 2
procedure zoot1
wait window "zoot1_2" timeout 2

Leonid

"Ook" <nousenetspam@zootal.nospam.com> wrote in message
news:%234S0d3RhGHA.3996@TK2MSFTNGP03.phx.gbl...
>I came across some odd behavior today, and would appreciate feedback
> on this. To demonstrate the issue, create two files:
>
> File 1: zoot.prg
>
> Procedure zoot
> =zoot1()
> set procedure to
> =zoot1a()
> return
>
> File 2: zoot1.prg
>
> PROCEDURE zoot1
> WAIT WIND `ZOOT1' TIME 1
> RETURN
> PROCEDURE ZOOT1A
> WAIT WIND `ZOOT1A' TIME 1
> RETURN
>
> Then in the command windows, DO ZOOT. It does the zoot1 wait window as
> expected. Surprisingly, it also does the zoot1a wait window. Why? I
> added the SET PROCEDURE TO line to clear any open procedure files,
> thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1, but it
> still works. CLEAR PROGRAM stops it from working. Is this an undocumented
> feature? I was not aware that DOing a PRG file would load make all
> procedures in the PRG available, even after the top level procedure was
> exited, and therefore no longer in the call stack.
>
> We also discovered that suspending VFP would clear it from memory, as if
> VFP arbitrarily clears such stuff when it wants to or thinks it needs to.
>
>
>



Re: finding procedures in a procedure file by Dan

Dan
Thu Jun 01 10:18:12 CDT 2006

Personally, I think the SET PROC thing is a bug but don't expect anyone to
expend any effort on it. <s> If you *really* want to remove open program
files from the cache, use CLEAR PROGRAM.

Dan

Ook wrote:
> I came across some odd behavior today, and would appreciate feedback
> on this. To demonstrate the issue, create two files:
>
> File 1: zoot.prg
>
> Procedure zoot
> =zoot1()
> set procedure to
> =zoot1a()
> return
>
> File 2: zoot1.prg
>
> PROCEDURE zoot1
> WAIT WIND `ZOOT1' TIME 1
> RETURN
> PROCEDURE ZOOT1A
> WAIT WIND `ZOOT1A' TIME 1
> RETURN
>
> Then in the command windows, DO ZOOT. It does the zoot1 wait window as
> expected. Surprisingly, it also does the zoot1a wait window. Why? I
> added the SET PROCEDURE TO line to clear any open procedure files,
> thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1, but it
> still works. CLEAR PROGRAM stops it from working. Is this an
> undocumented feature? I was not aware that DOing a PRG file would
> load make all procedures in the PRG available, even after the top
> level procedure was exited, and therefore no longer in the call stack.
>
> We also discovered that suspending VFP would clear it from memory, as
> if VFP arbitrarily clears such stuff when it wants to or thinks it
> needs to.



Re: finding procedures in a procedure file by Imaginecorp

Imaginecorp
Thu Jun 01 18:00:03 CDT 2006

Well not a 100%. But many moons ago I had run into something similar. In
those days (FPW) we used to create massive procedure files. Thinking as to
not tax memory on the old 386 computers with 64 MB of memory, I started
chopping up the procedure files. In a program, exactly what you did,
switching to another procedure program did not clear the previous one. The
way I caught it was 2 procedures with the same name and when called the
first one fired... Ended up by combining all procedures in one program about
500 lines long. (still have it, pretty neat stuff which took lines of code
is now a one liner in VFP).
Mohammed


"Ook" <nousenetspam@zootal.nospam.com> wrote in message
news:eW21UnShGHA.4656@TK2MSFTNGP04.phx.gbl...
> Are you sure? I tested it with FPD2.6 and it did not exhibit this
> behavior.
>
> "Imaginecorp" <imaginecorp@msn.com> wrote in message
> news:uhZ1ETShGHA.4276@TK2MSFTNGP03.phx.gbl...
>> Its been there since 2.5... Think about it. when a program is executed
>> its stored in memory. Clear program clears it form memory, Suspend takes
>> the program out of memory and executes line by line storing each in
>> memory.
>> Set procedure To is not meant to be in a program but is an external
>> directive.
>> Mohammed
>>
>>
>> "Ook" <nousenetspam@zootal.nospam.com> wrote in message
>> news:%234S0d3RhGHA.3996@TK2MSFTNGP03.phx.gbl...
>>>I came across some odd behavior today, and would appreciate feedback
>>> on this. To demonstrate the issue, create two files:
>>>
>>> File 1: zoot.prg
>>>
>>> Procedure zoot
>>> =zoot1()
>>> set procedure to
>>> =zoot1a()
>>> return
>>>
>>> File 2: zoot1.prg
>>>
>>> PROCEDURE zoot1
>>> WAIT WIND `ZOOT1' TIME 1
>>> RETURN
>>> PROCEDURE ZOOT1A
>>> WAIT WIND `ZOOT1A' TIME 1
>>> RETURN
>>>
>>> Then in the command windows, DO ZOOT. It does the zoot1 wait window as
>>> expected. Surprisingly, it also does the zoot1a wait window. Why? I
>>> added the SET PROCEDURE TO line to clear any open procedure files,
>>> thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1, but it
>>> still works. CLEAR PROGRAM stops it from working. Is this an
>>> undocumented feature? I was not aware that DOing a PRG file would load
>>> make all procedures in the PRG available, even after the top level
>>> procedure was exited, and therefore no longer in the call stack.
>>>
>>> We also discovered that suspending VFP would clear it from memory, as if
>>> VFP arbitrarily clears such stuff when it wants to or thinks it needs
>>> to.
>>>
>>>
>>>
>>
>>
>
>



Re: finding procedures in a procedure file by Ook

Ook
Thu Jun 01 22:44:16 CDT 2006

Subtle differences. One technically clears it from the cache (but doesn't),
the other removes it from memory. This is VFP, not c++. We should not have
to deal with cleaning up memory or program buffers. I vote for SET PROC...
being a bug for not "closing" the procedure file zoot1.prg. After I SET
PROCEDURE TO, I should not be able to execute zoot1a.


"Dan Freeman" <spam@microsoft.com> wrote in message
news:uX17Z6YhGHA.836@TK2MSFTNGP02.phx.gbl...
> Personally, I think the SET PROC thing is a bug but don't expect anyone to
> expend any effort on it. <s> If you *really* want to remove open program
> files from the cache, use CLEAR PROGRAM.
>
> Dan
>
> Ook wrote:
>> I came across some odd behavior today, and would appreciate feedback
>> on this. To demonstrate the issue, create two files:
>>
>> File 1: zoot.prg
>>
>> Procedure zoot
>> =zoot1()
>> set procedure to
>> =zoot1a()
>> return
>>
>> File 2: zoot1.prg
>>
>> PROCEDURE zoot1
>> WAIT WIND `ZOOT1' TIME 1
>> RETURN
>> PROCEDURE ZOOT1A
>> WAIT WIND `ZOOT1A' TIME 1
>> RETURN
>>
>> Then in the command windows, DO ZOOT. It does the zoot1 wait window as
>> expected. Surprisingly, it also does the zoot1a wait window. Why? I
>> added the SET PROCEDURE TO line to clear any open procedure files,
>> thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1, but it
>> still works. CLEAR PROGRAM stops it from working. Is this an
>> undocumented feature? I was not aware that DOing a PRG file would
>> load make all procedures in the PRG available, even after the top
>> level procedure was exited, and therefore no longer in the call stack.
>>
>> We also discovered that suspending VFP would clear it from memory, as
>> if VFP arbitrarily clears such stuff when it wants to or thinks it
>> needs to.
>
>



Re: finding procedures in a procedure file by Dan

Dan
Fri Jun 02 10:59:02 CDT 2006

Yes, subtle differences. One does what you want, the other doesn't. <g>

Dan

Ook wrote:
> Subtle differences. One technically clears it from the cache (but
> doesn't), the other removes it from memory. This is VFP, not c++. We
> should not have to deal with cleaning up memory or program buffers. I
> vote for SET PROC... being a bug for not "closing" the procedure file
> zoot1.prg. After I SET PROCEDURE TO, I should not be able to execute
> zoot1a.
>
>
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:uX17Z6YhGHA.836@TK2MSFTNGP02.phx.gbl...
>> Personally, I think the SET PROC thing is a bug but don't expect
>> anyone to expend any effort on it. <s> If you *really* want to
>> remove open program files from the cache, use CLEAR PROGRAM.
>>
>> Dan
>>
>> Ook wrote:
>>> I came across some odd behavior today, and would appreciate feedback
>>> on this. To demonstrate the issue, create two files:
>>>
>>> File 1: zoot.prg
>>>
>>> Procedure zoot
>>> =zoot1()
>>> set procedure to
>>> =zoot1a()
>>> return
>>>
>>> File 2: zoot1.prg
>>>
>>> PROCEDURE zoot1
>>> WAIT WIND `ZOOT1' TIME 1
>>> RETURN
>>> PROCEDURE ZOOT1A
>>> WAIT WIND `ZOOT1A' TIME 1
>>> RETURN
>>>
>>> Then in the command windows, DO ZOOT. It does the zoot1 wait window
>>> as expected. Surprisingly, it also does the zoot1a wait window.
>>> Why? I added the SET PROCEDURE TO line to clear any open procedure
>>> files, thinking that DOing zoot1 did an implicit SET PROC TO ZOOT1,
>>> but it still works. CLEAR PROGRAM stops it from working. Is this an
>>> undocumented feature? I was not aware that DOing a PRG file would
>>> load make all procedures in the PRG available, even after the top
>>> level procedure was exited, and therefore no longer in the call
>>> stack.
>>>
>>> We also discovered that suspending VFP would clear it from memory,
>>> as if VFP arbitrarily clears such stuff when it wants to or thinks
>>> it needs to.