Page 1 of 1

IP to Decimal converter

Posted: Sun May 14, 2017 9:28 am
by richmond62
IPD.png
10 minutes work.
IP to Decimal Converter.livecode.zip
Here's the stack.
(15.1 KiB) Downloaded 310 times

Re: IP to Decimal converter

Posted: Tue May 23, 2017 10:37 pm
by Ledigimate
Thank you Richmond.

I thought it might be useful if the decimal number could also be converted back to an IP address, so I gave it a try:

Code: Select all

   set the itemdelimiter to "."
   if fld "DEK" is an integer then
      put fld "DEK" into tNum
      put tNum div (256^3) into fld "EYEPEE"
      subtract fld "EYEPEE" * (256^3) from tNum
      put "." & tNum div (256^2) after fld "EYEPEE"
      subtract item 2 of fld "EYEPEE" * (256^2) from tNum
      put "." & tNum div 256 after fld "EYEPEE"
      subtract item 3 of fld "EYEPEE" * 256 from tNum
      put "." & tNum after fld "EYEPEE"
    end if
- Gerrie

Re: IP to Decimal converter

Posted: Wed May 24, 2017 5:01 pm
by richmond62
Well Ledgitimate/Gerrie there is no earthly reason why you shouldn't
download my stack, put your script into a new button, bung your
name on the front (next to mine if
you want to be fair) and re-uploading it.

Re: IP to Decimal converter

Posted: Thu May 25, 2017 8:33 pm
by Ledigimate
Okay, here it is :D

- Gerrie