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.