Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sys(5) gives different result?

Status
Not open for further replies.

shahatul

Programmer
May 28, 2002
23
US
I have a following code which gives me a different drive name in Window XP Professional or XP Home Edition. It works fine with Window 2000 or Win - 98.
for e.g., Window 2000 - &quot;F:\data\<filename>
Window XP - &quot;\\fs1\sys\data\&quot;
<< code start >>
Local cDocLocation, cDataDir
If empty(master.DataDir) && Field contains '\data\'
=MessageBox(&quot;Data Directory must set&quot;)
Else
cDataDir = alltrim(master.DataDir)
cDataDir = iif(rat(&quot;:&quot;, cDataDir) > 0, cDataDir, sys(5) ;
+ cDataDir)
Endif
<< code end >>
Any idea or anybody having same problem?

Thanks
 
Since sys(5) always returns the Default drive or volume name, it's really not an OS based result, but rather what your current DEFAULT is set to. e.g.
Code:
SET DEFAULT TO \\melange_41\win95
?SYS(5) && returns \\MELANGE_41\WIN95
SET DEFAULT TO f:\VFP70
?SYS(5) && returns F:
You'll need to change the code to allow for handling the \\server\volume variant as well as the drive.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top