Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Putting work files in the Windows temp dir
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00356594
Message ID:
00356935
Views:
9
> I want to put the work files in a directory off of the temp dir as defined by the TEMP enviornment var.


Will this help?

*!* Returns the Windows temp directory or an empty string.
*!* Directory is returned with a trailing backslash
LOCAL lcdirectory, lnsize lnReturnValue
lcdirectory = SPACE(255)
lnsize = 255

DECLARE INTEGER GetTempPath ;
IN WIN32API ;
INTEGER lnsize, ;
STRING @lcdirectory

lnReturnValue = 0
lnReturnValue = GetTempPath(lnsize,@lcdirectory)

IF lnReturnValue = 0
lcdirectory = ""
ELSE
lcdirectory = ALLT(lcdirectory)
*!* This Function may add a little box to the end of the string
*!* If if does there is no acsii equivalent to it so remove it
IF ASC(RIGHT(lcdirectory,1)) = 0
lcdirectory = LEFT(ALLT(lcdirectory),LEN(ALLT(lcdirectory))-1)
ENDIF
ENDIF

RETURN lcdirectory
Ronald L. Thorp
http://www.Fox-Pros.com
Fox-Pros, Inc.
Office 407-498-0100
Previous
Reply
Map
View

Click here to load this message in the networking platform