Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SYS(2023) returns wrong directory in VFP 9
Message
From
03/10/2005 13:35:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
SYS(2023) returns wrong directory in VFP 9
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01055565
Message ID:
01055565
Views:
109
VFP 9 help about SYS(2023) says:
SYS(2023) uses the Windows API GetTempPath to search for the path
containing the temporary files.
DECLARE INTEGER GetTempPath IN "kernel32"  ;
		LONG nBufferLength,  		STRING lpBuffer
LOCAL lnBufferLength, lnReturn
lnBufferLength = 512
lcBuffer = REPLICATE( " ", lnBufferLength )
lnReturn = GetTempPath( lnBufferLength, @lcBuffer )
* Strip the null delimiter before returning the value
MESSAGEBOX( 'GetTempPath: '+ STRTRAN( TRIM( lcBuffer ), CHR(0), '' ) + CHR(13) + ;
     'SYS(2023): '+SYS(2023) )
Produces different results:

GetTempPath: C:\WIND98\TEMP\
SYS(2023): C:\DOCUME~1\ANDRUS\LOCALS~1\TEMP

Why?
In VFP 7 results are the same.

My VFP 7 and 9 applications use SYS(2023) directory to communicate and this causes my code to fail. How to fix this?
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform