Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Sys(0)

SYS(0) returns the machine identification number and the identification of the user, if your network shell supports this functionality.

Usage

cID = SYS(0)

We usually don’t depend on this information being available. Single-user installations may not give us useful information. Under some network operating systems, SYS(0) is blank unless specific changes are made to the NOS configurations—changes our clients may be unwilling or unable to do. Some network shells do not provide this information, causing the function to return SPACE(15)+”#”+SPACE(1). Stand-alone installations (including those that have not started the network shell) return “1”. Bottom line: you need to test if this information is available on the specific installation you are working on. In a shrink-wrapped application, or one where you don’t configure the client’s workstation, count on SYS(0) returning blank information, somewhere, sometime.

Example

? SYS(0)        && "PROMETHEUS # troche" on Ted's NT machine
? SYS(0)        && "TAMAR'S DELL#Tamar " on Tamar's NT
                && machine

See Also

User()