Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to save the value of SET DEFAULT
Message
From
26/04/2001 01:58:09
 
 
To
26/04/2001 00:59:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00499918
Message ID:
00499995
Views:
26
She asked about PATH, and you're right, SET("PATH") is what you want.

Some people might think your code would store the current default path, let you do a CD to some other drive/path, then return to your original default directory. However, it will actually always return you to the root of your original drive instead.
?SYS(5) + CURDIR()
cPath=SET("PATH")
cDefault=SET("DEFAULT")
CD "D:\"
?SYS(5) + CURDIR()
** Blah blah blah
SET DEFAULT TO (cDefault)
SET PATH TO (cPath)
?SYS(5) + CURDIR()
>Well, no shit, Al, but that's not what was asked.
>
>>=SET("DEFAULT") only returns the drive, not the full current path, so you need CURDIR() as Phillip pointed out.
>>
>>>cPath=SET("PATH")
>>>cDefault=SET("DEFAULT")
>>>CD "D:\New Drive\New Dir"
>>>** Blah blah blah
>>>SET DEFAULT TO (cDefault)
>>>SET PATH TO (cPath)
>>>
>>>
>>>
>>>
>>>>>I want to change the SET DEFAULT. So first i want to save the value, set it, do something, then change it back. How do I save the value of SET DEFAULT?
>>>>>
>>>>>Thanks
>>>>>
>>>>>Brenda
>>>>
>>>>>>var = SYS(5) + CURDIR()
>>>>>>seT DEFAULT TO newdir
>>>>>>...
>>>>>>
>>>>>>SET DEFAULT TO (var)
>>>>
>>>>how do i save the current PATH?
>>>>
>>>>Brenda
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform