>Hi all,
>
>Is there a replacement for the old dBaseIII/Clipper ID() functions. My documentation states that ID() is no longer supported (although it does indeed work). I presume VFP has an alternate means of identifying a workstation on a network -- but I cannot find any command in Help. If it's there, its name would be appreciated.
You can get identification for the station in several ways; SYS(0) returns a string consisting of the NetBIOS name of the machine followed by a # followed by the name of the user logged into the machine. For example, on the machine I'm working on right now, SYS(0) returns
KALI#edr, since the machine name is
KALI, and I'm logged onto both the local system and the domain as
edr.
You can get the machine name via an API call:
DECLARE INTEGER GetComputerName IN WIN32API;
STRING @lpBuffer, ;
INTEGER @lpdwSize
cBuffer = SPACE(256)
nSize = 256
IF GetComputerName(@cBuffer, @nSize) # 0
? LEFT(cBuffer, nSize - 1)
ENDIF
The Windows Scripting Host's Wscript.Network object can do this:
oWshNet = CREATEOBJ('Wscript.Network')
? oWshNet.ComputerName
and there are probably more...