Try my new website:
www.urcho.com
- the new SIMPLE social network
Sign up
|
357
members |
125
snippets
Search for:
ALL
POPULAR
File Controls
Multiplayer Code
2D Effects
3D Effects
Oldskool demos
Basic Functions
Maths/Physics
Sound
Tutorials
Misc
Username:
Password:
Sign up
BlitzMax ConvertIP function by EdzUp
[
back
]
Author:
Archive
| Viewed:
980
times | Language:
BlitzMax
| Category:
Multiplayer Code
Function ConvertIP:Int( sIPAddress:String ) 'pass IP as a String e.g. "127.0.0.1" 'VARS Local iIP:Int Local iDotPos:Int = 0 Local iOldDotPos:Int = 0 Local strTemp:String Local Counter:Int = 3 'MAIN While Counter > 0 iOldDotPos = iDotPos iDotPos = Instr(sIPAddress, ".", iOldDotPos+1) strTemp = Mid(sIPAddress,iOldDotPos + 1, (iDotPos - iOldDotPos)-1) iIP = iIP + (Int( strTemp ) Shl (Counter * 8)) Counter = Counter - 1 Wend strTemp = Right(sIPAddress, (Len(sIPAddress) - iDotPos) ) iIP = iIP + (Int( strTemp ) Shl 0) Return iIP End Function
Author Comments:
This function will convert a string IP something like "127.0.0.1" to its integer equivalent. The original Blitz3d function was created by Perturbatio
Login or
create an account
to comment on this snippet