>>Sys(0) has worked for me quite well. Another thing I get from using it is the current user name if on network environment (which is 100% of the time). Can you post corresponding API (for getting user name that is)? TIA
>
>I hope that Ed doesn't mind too much my posting this.
Why would I? You've got it right AFA the local user goes! You do more API stuff here than I do...
>FUNCTION CurrentUser
>
> DECLARE INTEGER WNetGetUser IN Win32API;
> STRING @lpszLocalName, STRING @lpszUserName,;
> INTEGER @lpcchBuffer
> LOCAL lcresult, lcbuffer, lnsize, lnerr, lnpt
> lcresult = ""
> lcbuffer = SPACE(200)
> lnsize = LEN(lcbuffer)
> lnerr = WNetGetUser(0, @lcbuffer, lnsize)
> * If lnerr doesn't equal 0 WNetGetLastError
> * should be called
> IF lnerr = 0
> lnpt = AT(CHR(0), lcbuffer)
> IF lnpt > 1
> lcresult = LEFT(lcbuffer, lnpt - 1)
> ENDIF
> ENDIF
> RETURN lcresult
>ENDFUNC
>hth,