KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to get the IP address of a hostname
PRODUCT: 4D Internet Commands | VERSION: 2004.4 | PLATFORM: Mac & Win
Published On: August 25, 2006
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

You can get the IP address of a hostname provided using the command NET_Resolve of the 4D Internet Commands. Below is sample method that does this:

C_TEXT($1;$0)
C_TEXT($hostname;$IPHost)
C_LONGINT($err)
$hostname:=$1
$err:=NET_Resolve ($hostname;$IPHost)
$0:=$IPHost