Convert IP Address to a String...NOOB

Just starting out? Need help? Post your questions and find answers here.
KidNovak
New User
New User
Posts: 6
Joined: Sun Sep 03, 2006 12:39 am

Convert IP Address to a String...NOOB

Post by KidNovak »

Yep I'm a NOOB.

I'm trying to convert an IP ADDRESS (ex. 10.10.10.10) to a String(ex. "10.10.10.10").


Thank you for the help.
Novak
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

Code: Select all

Procedure.s ipAddressToString( ip.l)
  ipStr.s=""
  For i.l=0 To 3
    ipStr.s=ipStr.s+Str(IPAddressField(ip.l,i))+"."
  Next i
  ipStr.s=Left(ipStr.s,Len(ipStr.s)-1)
  ProcedureReturn ipStr.s
EndProcedure
This proc from CodeArhiv: Internet&Co/IP / IPCalculator.pb
POiNT.OF.PRESENCE group
maw

Post by maw »

Or you simply use the builtin command :lol:

Code: Select all

ipaddress$ = IPString(IPAddress)
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

maw wrote:Or you simply use the builtin command :lol:

Code: Select all

ipaddress$ = IPString(IPAddress)
LOL :mrgreen: :mrgreen: :mrgreen: :mrgreen:
KidNovak
New User
New User
Posts: 6
Joined: Sun Sep 03, 2006 12:39 am

Post by KidNovak »

Thanks for the Help.

I can't believe I missed "IPString" and "IPAddressField" in the Manual. :oops:
I went through all of the String commands and Math commands, but missed the IP commands.


I purchased Purebasic because it's great programming Language and this Forum is a Great help.

Thanks again,
Novak
Post Reply