Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getfile question
Message
From
31/03/2000 18:41:43
 
 
To
31/03/2000 17:57:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00353361
Message ID:
00353716
Views:
13
>>save a little effort - FULLPATH(CURDIR()) will return the current directory properly prefixed without the ambiguity that I've seen arise from using SYS(5) on UNCs where you're working in an unmapped UNC, and terminates cleanly with the \ in all cases. YMMV - I avoid SYS(5) like the plague. You can also force the return from GETFILE to specify a FULLPATH() IAC, so the following is better form from my POV at least:
>
>Point taken. However, Allen specified that he wants to know that it is in the _application_ directory. It seems that your way would potentially find a file elsewhere.

Absolutely - and it -tells- you that you did just that!!!!!!!! GETFILE() inherently can move around, and can be used to return the name of a file that doesn't exist if you type in the file name. If you want to point to a directory and force the user to pick from just that place, and only things that really exist in that place, GETFILE() doesn't play that game.

From my POV, if you want to force a choice to be made from an existing, especific location, GETFILE() is ABSOLUTELY, UNEQUIVOCABLY the wrong function to use - it's the "I'm too lazy to do this right" syndrome, GTEFILE() looks sorta right, and probably the use of a listbox built from a list of files in the right place so that you can only pick something that's there with the extension you want and resolve the "waaah - it ain't in the right directory" blues.

I have no (0, nada, ziltch) pity here. GETFILE() isn't up to lots of tasks I'd like it to do. If this is one of those cases (and the description of the problem you give tells me it just might be) I don't use GETFILE() and then try to code around the shortcomings. I'd expect a hefty welt left by a wet, squirmy brook trout if I did that in code I handed to you...

FULLPATH(CURDIR()) is a better version of SYS(5)+SYS(2003), and you've gone and made a horrid mistake, here, fishlady - you've gone and a$$umed that the current directory is the application directory!!! GETFILE() can be used with FULLPATH() and then tested with FULLPATH(Blah, blah, stupid directory) to make sure the idiot end-user didn't make use of the power handed to them by the immensely lazy programmer who was lacking in neurochemical energy expenditure when they decided that GETFILE() was just the ticket. It was - a clear ticket to an invite to off.ramp if they really want to know what I think of the bad habit of using GETFILE() incorrectly...I can't use the requisite vocabulary here.

It's gonna be a long weekend...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform