Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ID()
Message
From
24/01/1999 15:53:07
 
 
To
24/01/1999 15:27:34
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: ID()
Miscellaneous
Thread ID:
00179605
Message ID:
00179613
Views:
22
>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)  && nSize includes the null
ENDIF
The Windows Scripting Host's Wscript.Network object can do this:

oWshNet = CREATEOBJ('Wscript.Network')
? oWshNet.ComputerName

and there are probably more...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform