Mike Lewis said:
It takes a moment to test this
Of course I see this, but you don't seem to take in that I can't verify if that was always the case with earlier VFP versions or windows versions by executing this with just my current Windows version and VFP version. I take in that Tamar confirms this, too.
Then the help documentation of the return value of SET('DEFAULT') to be
Help on SET() function said:
is a documentation bug. It still makes me a bit suspicious, that the plan still was SET('DEFAULT') works like the undocumented SET('DIRECTORY').
All that aside, in the grand scheme the question was how the program buffer doesn't kick in and thus allows a construct with two same name PRGs in different directories to work. The program buffer seem to depend on how you call a PRG. And the observation about SET('DEFAULT') made it a candidate for the reason the program buffer doesn't work as expected.
At this point I want to point out that the program buffer was a topic in several threads here:
thread184-1814250
thread184-1813648
And I think at least one more I don't find right away.
Again starting with the non-ideal situation of two PRGs with same name, when and how program buffering takes place is a bit of an unsolved mystery, unless you disbelieve USMA99 saying that the pattern of SET DEFAULT TO cDirectory and then calling programs in that directory worked so far without a program buffer kicking in and executing a program with same name but from another directory. Unless recently.
The essential statement about how he executes PRGs is:
Code:
I sometimes use DO WITH or other times use perenthesis with parameters, but without parameters I have never included the extension or parens and simply say DO basename.
I read this as calls to a basename.prg are made like
Code:
DO basename WITH param1,param2
or
or
but in the case basename.prg doesn't have parameters always just
What the application never does is a call like basename() without parameters.
Just taking the experience of my example in thread184-1814250, the reason all this worked so far may be precisely about that, because the program buffer only became active when the not used calling convention of basename() is used. So there are some more tests to be done with a PRG that has parameters and I'm now pretty sure we'd just reveal a bug in program buffering. If the program buffer would buffer all PRGs called any way we all would be much more aware of CLEAR PROGRAM and the fact that CLEAR ALL doesn't include CLEAR PROGRAM, too.
To me that's a good learning, as I can use the program buffer more effectively when knowing what makes it buffer a PRG and what not.
I'm writing all this before making more experiments instead of doing that first and I know that's some king of waste of time, as I simply could come up with final results, but I also have the feeling there will be no definite reproducible result as it may also depend on one or more settings of VFP or even Windows.
I hope I can make you more aware of the precise problem we face here. We could wipe the problem from the table as unimportant to resolve, because you simply can work by the rule of no same name PRGs or classes or anything and then the ambiguity of it is solved no matter how the program buffer works and has changed behavior. It won't matter. And while that is the solution I'd also recommend to use, it still is interesting to me to investigate further into how and when and why the program buffer works. The criticism about that I get from all sides isn't silencing that interest, sorry for however that annoys anyone, I don't want to sweep this under the rug but go deeper into that rabbit hole.
I hope even if you don't share that sentiment you at least will understand my point now.
Chriss