You can use the API functions GetComputerName and GetUserName:
cUser=Space(32)
nSize=Len(cUser)
Declare Integer GetUserName In Win32API String@, Integer@
nResult=GetUserName(@cUser, @nSize)
cStation=Space(32)
nSize=Len(cStation)
Declare Integer GetComputerName In Win32API String@, Integer@
nResult=GetComputerName(@cStation, @nSize)
Both of these should return 1 if ok. If they return zero (false), then check the value of nSize (this will tell you how big the string needs to be) and try again with string the size of (nSize+1).
>Hi,
>
>I've found a problem with the SYS(0) function. I work on an in-house database system, which most users use in a network setting, with a few working on stand-alone computers.
>
>I've been using SYS(0) to get the user and computer names which has been working fine until now. One of the stand-alone users had a problem with copying files from their computer to another and had to restart their computer. After that, we found that the SYS(0) function is returning a blank for the username.
>
>Does anyone know where SYS(0) looks? Alternatively, is there another way of getting this information?
>
>Thanks,
>
>Stewart