* Declare the API function. DECLARE INTEGER GetUserName IN Win32API STRING @S, INTEGER @I * Define the buffer size and destination variable. lnDWord = 20 lcBuffer = SPACE(m.lnDWord + 1) && One for the trailing NULL * Try the API function. IF (GetUserName(@m.lcBuffer, m.lnDWord) = 1) * Use the API call results. lcUserID = STRTRAN(ALLTRIM(m.lcBuffer), CHR(0), []) ELSE * Use the FoxPro function. lcUserID = ID() ENDIF