It's because the field I needed to access in the HostInfo structure is defined as a pointer to an array of pointers to ip-addresses.
So the first line gets the top level pointer.
The next line gets the pointer at the top of the array of pointers.
The next line follows the pointer to get the address of the address list.
The next line adjusts this by 4 for each 'index' to get the required address.
The next line does a translation by passing the contents of this final address to inet_ntoa which converts the ip address in memory to it's textual representation.
Actually, now I look at the code again, the code should technically be this:
p=HostInfo+12 : ` Get address of the top level pointer
p=*p : ` Get the address of the array of pointers
p=p+(index*4) : ` Adjust to get the right pointer
p=*p : ` Get the address of the ip-address
ip=Call Dll(DLLNUM,"inet_ntoa",*p) : ` Convert to text
Luckily windows keeps the ip-addresses stored in a table form
Um, converting to DBC ... very, very difficult. You'd need to use a memblock to store the original data in, access the CopyMemory function from the kernel32.dll to copy the contents of the addresses to another memblock where you could read them. You'd then be able to mimic what my code does.
Alternatively, why not get someone to write a DLL for you (not me I'm afraid ... I'm in the middle of something ATM).