New topic: Compare binary or hex values
<http://forums.realsoftware.com/viewtopic.php?t=33591> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message pbart Post subject: Compare binary or hex valuesPosted: Thu Apr 29, 2010 3:02 am Joined: Sat Oct 10, 2009 6:40 am Posts: 98 Hi I have written 2 simple functions to turn an IP address into a 32bit binary or hex string i.e. &b11111111111111111111111111111111 or &hffffffff What I would like to know is if I use the < or > operators to compare against another IP address will this compare it as hex/binary value or will it just see it as a normal string. i.e Code:Dim Hex1 As String = &hffffffff Dim Hex2 As String = &hffffff00 If Hex1 > Hex2 Then //do something end if I am trying to compare IP addresses to see if they are in the correct range for the desired network. _________________ Regards Paul Windows 7 32bit RB 2010.1 Top pbart Post subject: Re: Compare binary or hex valuesPosted: Thu Apr 29, 2010 7:04 am Joined: Sat Oct 10, 2009 6:40 am Posts: 98 OK, I think I've answered my own question. I have done some testing and it seems to work. Can anyone see any problems with this, that I might have missed? _________________ Regards Paul Windows 7 32bit RB 2010.1 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
