FUNCTION GetWinDir DECLARE INTEGER GetWindowsDirectory IN Win32API ; STRING @cLocation, ; INTEGER nSize LOCAL cLocation, nSize cLocation = SPACE(256) nSize = GetWindowsDirectory(@cLocation, 256) IF nSize > 0 * * Got it - it's the size of the return * cLocation = LEFT(cLocation,nSize) ELSE * * An error occurred when retrieving the value - return the null string * cLocation = '' ENDIF return cLocation