Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do prg ignoring my path?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Do prg ignoring my path?
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01085178
Message ID:
01085178
Views:
83
Bit of a puzzling one, I have a class that is compiled to an exe, this class is started by another program and a prg name including full path is passed to one of it's functions.

the class then does a
do (passedprg)
this has worked since pretty much the beginning of time when the dinosaurs roamed and I could fit into most of my jeans.

yesterday I tried a new prg which just happened to be called main.prg again it had the full path included yet did not work

Now try to keep up, I eventually worked out that my errhand.prg included in the class project is stored in a folder along with a main.prg (not THE main.prg), this main.prg is not part of the project and infact contains nothing at all. the default path in the class is never programatically set to that folder and all sense tells me that it and any other prg's in that folder should be ignored unless I say so.

however that main.prg was the main.prg it decided to run.

My best guess is this:

1. When the class is compiled the folder containing the errhand is added as part of the searchpath.
2. When the prg is passed to the class I
set default
to the justpath of it (this is because some of the prg's just look for tables and such locally)
3. When the class does the
do (fullpath)main.prg
foxpro decides to try to be clever, it notes that the full path supplied is the same as the deafult I've just set and translates the call to just
do main.prg
this then hits the aforementioned main.prg in the accidental search path and all goes tits up.

Sounds unlikely I know but after spending a day swearing at my computer it's all I could come up with.

Surely this override when the fullpath is included is wrong, or is there a setting I need to look at?

For the moment I've moved the errhand.prg to a folder with no other prg's, this has for the moment solved the issue, but the chance of reoccurance worries me.

Will a
set default to
at the start of the class function to clear all search paths solve this? I havn't tested this yet.

any ideas on causes and solutions would be great.

Ken.
Next
Reply
Map
View

Click here to load this message in the networking platform