Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Directories
Message
From
10/12/2007 18:26:31
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01274583
Message ID:
01274642
Views:
14
>I don't see any reasons to jump between folders like that.
>Of course don't know your application logic.
>
>
>lcCurrentFolder = ADDBS(SYS(5)+CURDIR())
>cd ..
>REPORT FORM (lcCurrentFolder+[whatever name report has])
>cd (lcCurrentFolder)
>
I agree completely here - one should not assume that the application is somewhere, because it can be anywhere :).

Case in point, many document-oriented printer drivers have the nasty habit to change the directory to where they are supposed to be creating the file - which is usually somewhere below GETENV("USERPROFILE"), i.e. in "my documents" or so. Amyuni used to do that, the PostScript driver (not sure, haven't tried it in a while), and the M$ Office Document Image Writer too. So doing a "CD .." (with a mandatory space, CD.. worked in DOS but won't in Fox) is one up from... where were we? Where will we be then?

So any directory movement should either be avoided, or should be neatly bracketed with storing the current location into a variable first, then doing any risky business, then going back to wherever the variable says we were.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform