SERVER.ADDR()

SERVER.ADDR()

Top  Previous  Next

 

The SERVER.ADDR() function returns the IP address for a given server name.

 

 

Format

 

SERVER.ADDR(server.name)

 

where

 

server.nameis the name of the server for which the IP address is required.

 

 

The SERVER.ADDR() function can be used to find the IP address of a network server from its name. This function is not usually needed as the QMBasic socket functions work with either IP addresses or server names.

 

If successful, the STATUS() function will return zero. All error conditions return a null string as the IP address and subsequent use of the STATUS() function will return the error code.

 

 

Example

 

DISPLAY SERVER.ADDR("openqm.com")

 

This statement displays the IP address of the openqm.com server.

 

 

See also:

Using Socket Connections, ACCEPT.SOCKET.CONNECTION, CLOSE.SOCKET, CREATE.SERVER.SOCKET(), OPEN.SOCKET(), READ.SOCKET(), SELECT.SOCKET(), SET.SOCKET.MODE(), SOCKET.INFO(), WRITE.SOCKET()