>Heres a simple example to fit your needs. Do this in a test:-
>
>DECLARE INTEGER GetWindowsDirectory IN Win32API; && Strict function name
>STRING lcBuffer; && to store the directory name
>INTEGER lnBufSize && to tell function max length
>
>STORE SPACE(100) TO lcBuffer
>GetWindowsDirectory(@lcBuffer,LEN(lcBuffer)
>
>lcBuffer will then contain the windows directory (with null terminator) look for null within the string (LEFT(lcBuffer,AT(CHR(0),lcBuffer)) to get directory.
>
*** You may need to change above to lnResult=GetWindowsDirectory(... then lnResult will contain length of data in lcBuffer (including terminator). It may be easier to then say lcWinDir=LEFT(lcBuffer,lnResult-1) after checking lnResult for non-positive values first (0 or negative=error).