# Could you Use a Xojo Subnet Calculator Class?

**URL:** <https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414>\
**Category:** General\
**Created:** [February 18, 2014, 1:55pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414 "2014-02-18T13:55:40Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [February 18, 2014, 1:55pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/1 "2014-02-18T13:55:40Z")

</div>

I am taking a quick poll if there are those out there that would find a Xojo Subnet Calculator and IP Address Range Validator Class helpful? I have it written for my app and I will make it “other user friendly” if there is interest.

Thanks  
Mike

---

<div class="post-metadata">

**Author:** ![Dirk\_Cleenwerck](https://forum.xojo.com/user_avatar/forum.xojo.com/dirk_cleenwerck/32/533_2.png) [@Dirk\_Cleenwerck](https://forum.xojo.com/u/Dirk_Cleenwerck)\
**Post date:** [February 18, 2014, 2:23pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/2 "2014-02-18T14:23:14Z")

</div>

I could use that.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [February 18, 2014, 2:38pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/3 "2014-02-18T14:38:57Z")

</div>

Cool I am creating a Demo Wrapper App to show off some of the class methods/functions.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [February 18, 2014, 2:39pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/4 "2014-02-18T14:39:32Z")

</div>

Ill also make a Public Repository on my GitHub account when Im done.

---

<div class="post-metadata">

**Author:** ![Dirk\_Cleenwerck](https://forum.xojo.com/user_avatar/forum.xojo.com/dirk_cleenwerck/32/533_2.png) [@Dirk\_Cleenwerck](https://forum.xojo.com/u/Dirk_Cleenwerck)\
**Post date:** [February 18, 2014, 2:50pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/5 "2014-02-18T14:50:35Z")

</div>

Sounds good. I have your GitHub bookmarked 🙂

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [February 18, 2014, 8:50pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/6 "2014-02-18T20:50:00Z")

</div>

Sorry I got stuck on some math, but all good now. Just need to add a thread and a “please wait while we crunch numbers” progress bar 🙂

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [February 20, 2014, 5:42am UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/7 "2014-02-20T05:42:40Z")

</div>

[https://github.com/mikecotrone/Xojo\_SubnetCalculatorClass.git](https://github.com/mikecotrone/Xojo_SubnetCalculatorClass.git)

Dirk I am still making a few adjustments to the listbox load in this demo app, but it is working. I will finish the two bugs off in the am 😉 thanks!

---

<div class="post-metadata">

**Author:** ![scott\_boss](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@scott\_boss](https://forum.xojo.com/u/scott_boss)\
**Post date:** [March 3, 2014, 1:28am UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/8 "2014-03-03T01:28:28Z")

</div>

I dont remember what it is called, when the IPs in a subnet arent contiguously numbered… those are really weird subnet masks. so IPs 192.168.1.2 and 192.168.1.3 arent in the same subnet.

Does this handle those situations? just curious… I am asking questions/posting answers instead of coding…

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 3, 2014, 6:40pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/9 "2014-03-03T18:40:22Z")

</div>

Hi Scott. My class will handle Classless and Class Full subnetting so for example your /23 would encompass two /24 networks. Is that what you are asking?

I hope you aren’t getting in ATL what we are getting here in NC. Frozen again 🙂

---

<div class="post-metadata">

**Author:** ![scott\_boss](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@scott\_boss](https://forum.xojo.com/u/scott_boss)\
**Post date:** [March 3, 2014, 10:24pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/10 "2014-03-03T22:24:46Z")

</div>

I am talking about RFC 950 - Support For Non-Contiguous Masks…

and ATL is going to be ICE ICE BABY tonight… yeah 70s on SUN, and tonight we have ICE. yeah!

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 3, 2014, 10:33pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/11 "2014-03-03T22:33:32Z")

</div>

Gotcha! So No, but it should be an easy yes add. 😉

to calculate Discontinuous Subnets you have to use the XOR function on the Individual Subnets similar to this:

```auto
74.18.23.0/24 - 01001010 . 00010010 . 00010111 . 00000000 
68.34.14.0/24 - 01000100 . 00100010 . 00001110 . 00000000 
84.51.20.0/24 - 01010100 . 00110011 . 00010100 . 00000000 

XOR Result ---- 00011110 . 00110001 . 00011011 . 00000000 = 30.49.27.0 
```

The way I wrote the class was of two ways initially. 1. Send an IP/Subnet/Mask for validation getting back a single range 2. Send an IP/Subnet/Mask for All Ranges. I could add a third which would change the interface a bit, but it would require you to “Add” multiple individual IP/Masks and then click on that button that triggers the methods/function to return the XOR of the Subnet/Masks added.

If you think there is a need for this these days let me know and Ill see about adding it.

Thanks Scott!

PS Its snowing again here in Greensboro, NC ☹

---

<div class="post-metadata">

**Author:** ![scott\_boss](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@scott\_boss](https://forum.xojo.com/u/scott_boss)\
**Post date:** [March 3, 2014, 10:39pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/12 "2014-03-03T22:39:14Z")

</div>

I have no need as of today. I know I have used them in the past at some places that used them for another layer (of many) of security. I personally have not run into one in the last 5ish years.

I wouldnt put the effort into it unless you get bored at 2am and need something to clear your mind (by coding).

Good luck with the snow…  
Ice comes about 11pm or so tonight for us.

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [March 3, 2014, 10:47pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/13 "2014-03-03T22:47:08Z")

</div>

I feel bad for you guys. Meanwhile, it was supposed to snow heavily here today and we didn’t even get flurries. I take this to mean that it will not snow again this season, I won’t have to shovel any more, and I’m not even remotely jinxing things by typing this.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 3, 2014, 11:01pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/14 "2014-03-03T23:01:22Z")

</div>

I left Long Island to escape the Snow 😉 Now look at me 🙂

[https://twitter.com/Mike\_Cotrone/status/440615794876370944/photo/1](https://twitter.com/Mike_Cotrone/status/440615794876370944/photo/1)

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 3, 2014, 11:03pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/15 "2014-03-03T23:03:08Z")

</div>

[quote=69115:@scott boss]I have no need as of today. I know I have used them in the past at some places that used them for another layer (of many) of security. I personally have not run into one in the last 5ish years.

I wouldnt put the effort into it unless you get bored at 2am and need something to clear your mind (by coding).

Good luck with the snow…  
Ice comes about 11pm or so tonight for us.[/quote]

You and me both. Heck I don’t think I have really summarized any Enterprises in the last 6 years also. Just Service Providers.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:05pm UTC](https://forum.xojo.com/t/could-you-use-a-xojo-subnet-calculator-class/14414/16 "2020-10-29T17:05:10Z")

</div>


