Post
by Jeff Luther » 16 Mar 2006, 17:53
Posted by: Jeff Luther
I have seen this too: with a File/Open... in TD its initial directory is what-
ever was the last directory opened in another Windows application. There are
a couple ways to handle managing what your 'home'/current directory should be:
1) I'm working with a group now and our solution is to maintain startup_parms
info. in a UDV - a functional class. Info. like start/home directory, user
name/password, authority privleges on the db, etc. are stored at pgm. start.
Later, we always make sure we pass the full path for any file we open. That
way we can find any QRPs or other files.
2) I've also kept this info. in a .INI file, like home=, etc. (You can
see this in action with my analyze utility, available on the linked page
shown below. Run TD_Analyze and note the 1st time it's run it looks for its
INI file. If it doesn't find it, it writes one to disk -- saving the directory
where the appl. was started from -- and uses that first time opportunity to
display a welcome msg. and the About box.
Here some other info. from your msg:
> 1 - How can I get the current directory? - SalFileGetCurrentDirectory ( strPath )
> 2 - How can I set the curent directory? - SalFileSetCurrentDirectory ( strPath )
"With VisDosGetCurDir" - Right, and Help for this function references another
VT function called VisDosGetCurDrive(), which isn't even available in TD!
Best Regards,
Jeff Luther/PC Design
info: www.pulpcards.com/gupta/