"TheEndless" wrote:
I don't think that will work. GetIPAddrs returns an associative array, not an array, so there is no index "0".
Yeah, shame on me for posting before testing :oops:
Last night i was doing it like so
ipAA = createObject("roDeviceInfo").getIpAddrs()
for each eth in ipAA:
ip = ipAA[eth]
end for
but on back of my mind was bothering me ip may remain un-initialized and i also like shorter and self-maintaining code, as possible. This morning for some reason i thought i can go shorter. Could it be true that
night owls are wiser?
I posted and lunchtime went to the park to get some exercise skating, where it dawned on me numeric indexing won't work. It's amusing, my thinking seems clearer away from the computer during unrelated activities. I rushed on my phone to the forums to delete my mistake... too late. Anyway, ifEnum is what i was thinking, something like (alas, lame) this :
IPs = createObject("roDeviceInfo").getIpAddrs()
IPs.reset()
ip = IPs[IPs.next()]