Re: [RESOLVED] Getting the path to a file
Quote:
Originally Posted by
jmsrickland
So, actually, Path = "..\Data" is better than Path = App..Path & "\..Data"
Not really, but it works in the degenerate case where CD = App.Path. When that isn't true everything falls apart!
Note that even using File Open or File Save common dialogs can change the CD of a program while it runs.
So if you mean App.Path always use App.Path.
Re: Getting the path to a file
Quote:
Originally Posted by
jmsrickland
Actually, it's your fault. If you had responded earlier there wouldn't have been 24 posts:)
I had no idea what you wanted until you drew a picture.
Re: [RESOLVED] Getting the path to a file
Quote:
Originally Posted by
dilettante
Not really, but it works in the degenerate case where CD = App.Path. When that isn't true everything falls apart!
Note that even using File Open or File Save common dialogs can change the CD of a program while it runs.
So if you mean App.Path always use App.Path.
If I use Path = App.Path & "..\Data"
and then later use a common dialogue to find a file somewhere else will that screw up Path?
Re: [RESOLVED] Getting the path to a file
No.
App.Path never changes.
Re: [RESOLVED] Getting the path to a file
OK, thanks. I changed it back to Path = App.Path & "..\Data"
Re: [RESOLVED] Getting the path to a file
HAHA This thread is awsome! I think you (jmsrickland) already the answer of your question. Simple, use "App.Path".
Re: [RESOLVED] Getting the path to a file
No, Max. I only knew of App.Path & "\Data\Myfile.text" but that would not have worked. What I didn't know was App.Path & "..\Data" which dilettante posted.
Re: [RESOLVED] Getting the path to a file
Ah, ok. Well I'm glad your happy with what dilettante told you. :)
Re: [RESOLVED] Getting the path to a file
Quote:
Is there is way to get the path of a file that is not in the App.Path?
while this appears to be resolved, the searchtreeforfile API appears to fulfill the original request