hostNameToAddress not working???
Dave
dave at looktowindward.com
Fri Feb 15 13:51:32 EST 2008
It's ok, you just need to append ".local" to the return value of "the
hostName".
All the Best
Dave
On 15 Feb 2008, at 18:36, Alex Tweedly wrote:
> Dave wrote:
>> Hi All,
>>
>> I have the following function:
>>
>> ------------------------------------------------------------------
>> --
>> -- Get the LAN IP Address of this Machine
>> --
>> ------------------------------------------------------------------
>> function IPMGetHostIPAddressLAN
>> local myHostIPAddress
>>
>> put hostNameToAddress(the hostName) into myHostIPAddress
>> return myHostIPAddress
>> end IPMGetHostIPAddressLAN
>>
>>
>> This used to work fine and return the local LAN address of the
>> machine the Script is running on, I just tried it and now it just
>> returns empty.
>>
>> I originally cribbed this from Richmond's "Get IP Address" stack.
>> I download this again from rev online and it too fails. From this
>> stack:
>>
>> on mouseUp
>> put "Public IP =" && url "http://xtalk.memebot.com/cgi-bin/
>> ip.cgi" into line 1 of fld "F1"
>> put "Local IP =" && hostnametoaddress ("localhost") into line 2
>> of fld "F1"
>> put "LAN IP =" && hostnametoaddress(the hostname) into line 3
>> of fld "F1"
>> end mouseUp
>>
>> When I run this I get "empty" as the LAN Address. The other two IP
>> address fields are filled in ok.
>>
>> Could anyone shed any light on why this has stopped working and
>> how I can obtain the LAN IP address?
>>
> Which machine ? OS ? Rev version ?
>
> It would be interesting to see the output from
> put the hostname && ":" && hostnametoaddress(the hostname)
>
> to see whether the hostname has been set properly (and then to see
> whether the host name to address mapping is OK).
>
> if you're on a Mac, try opening a terminal window, and look at the
> output from
> echo $HOSTNAME
> if you're on a PC, ummmm .... I forget :-) - but look at what the
> system thinks the hostname is.
>
> --
>
> Alex Tweedly mailto:alex at tweedly.net www.tweedly.net
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list