# Joe Strouts ArrayUtils Module (conversion to API2)

**URL:** <https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051>\
**Category:** Getting Started\
**Created:** [December 27, 2020, 11:21pm UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051 "2020-12-27T23:21:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeannot\_Muller](https://forum.xojo.com/user_avatar/forum.xojo.com/jeannot_muller/32/13359_2.png) [@Jeannot\_Muller](https://forum.xojo.com/u/Jeannot_Muller)\
**Post date:** [December 27, 2020, 11:21pm UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051/1 "2020-12-27T23:21:46Z")

</div>

Joe Strout wrote ages ago a toolset: **ArrayUtils Module** for manipulations of arrays beyond Xojo’s out-of-the-box functionality.

I converted this plugin to Xojo API2, available below, and included the original code for archiving purposes.

> **[Xojo ArrayUtils API2](https://medium.com/learn-xojo/xojo-arrayutils-api2-19182fcb5928?sk=f26970c759767a13e6d389c81ed3d279)**
>
> After my conversion of Joe Strout’s “StringUtils Harness” to API2 it probably doesn’t come at a surprise that I converted as well his…

For string manipulations, please look [here](https://forum.xojo.com/t/joe-strouts-stringutils-module-conversion-to-api2/60038).

---

<div class="post-metadata">

**Author:** ![John\_McKernon](https://forum.xojo.com/user_avatar/forum.xojo.com/john_mckernon/32/183_2.png) [@John\_McKernon](https://forum.xojo.com/u/John_McKernon)\
**Post date:** [December 28, 2020, 12:29am UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051/2 "2020-12-28T00:29:18Z")

</div>

Thank you for doing these conversions, I wondered what had become of them.

---

<div class="post-metadata">

**Author:** ![Jeannot\_Muller](https://forum.xojo.com/user_avatar/forum.xojo.com/jeannot_muller/32/13359_2.png) [@Jeannot\_Muller](https://forum.xojo.com/u/Jeannot_Muller)\
**Post date:** [December 28, 2020, 10:41am UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051/3 "2020-12-28T10:41:07Z")

</div>

Thank you @John_McKernon. Joe doesn’t seem to develop with Xojo any longer. Some of the other contributors are still on board, but they probably just changed the code themselves, or not at all (as we don’t really need to change it).

I did this exercise to train myself in API2 and then I had the idea of sharing it as it might be useful to others as well. I wrote an article on my experience, FWIW 😉 .

> **[Why Moving To Xojo API 2.0?](https://medium.com/learn-xojo/why-moving-to-xojo-api-2-0-755a0bf482cc?sk=a056b4cd99bb4a4f9b6c4ae95508411b)**
>
> First of all there is no need to be in a rush! API 1.0 will continue to stay for long, as Xojo has officially communicated: “Moving to API…

---

<div class="post-metadata">

**Author:** ![Robert\_Livingston](https://forum.xojo.com/user_avatar/forum.xojo.com/robert_livingston/32/255_2.png) [@Robert\_Livingston](https://forum.xojo.com/u/Robert_Livingston)\
**Post date:** [December 29, 2020, 5:39am UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051/4 "2020-12-29T05:39:56Z")

</div>

One thing you might add in your project (since we are starting afresh) is to replace _ReDim_ with the new _Arrays.ResizeTo_.

As the documentation says:

> Redim exists for Visual Basic compatibility only. Use Arrays.ResizeTo instead.

Thanks a lot for your contribution. For me, it is a great exercise to work through and understand tested code. I also can add it to my toolset.

---

<div class="post-metadata">

**Author:** ![Jeannot\_Muller](https://forum.xojo.com/user_avatar/forum.xojo.com/jeannot_muller/32/13359_2.png) [@Jeannot\_Muller](https://forum.xojo.com/u/Jeannot_Muller)\
**Post date:** [December 29, 2020, 10:31am UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051/5 "2020-12-29T10:31:19Z")

</div>

@Robert_Livingston thank you very much for bringing this to my attention. I created an own article to collect these (and potentially future) changes and I added you to the notes as a contributor.

> **[Updates On Xojo API2 Conversion](https://medium.com/learn-xojo/updates-on-xojo-api2-conversion-d663f2707972?sk=119241152b4a88ea242f037ae6f19007)**
>
> As mentioned, I converted two Xojo libraries from API1 to API2:

I like that you embraced my recommendation to run the exercise on your own.

I really believe it is the best way to better understand the changes. Overall they are simple, but it is a change in mindset, and we need to get used to it. Funny thing is that it took me years to remember where Xojo was _1-based_, but now I’m struggling sometimes to keep in mind that everything is now _0-based_ 🙂

---

<div class="post-metadata">

**Author:** ![Robert\_Livingston](https://forum.xojo.com/user_avatar/forum.xojo.com/robert_livingston/32/255_2.png) [@Robert\_Livingston](https://forum.xojo.com/u/Robert_Livingston)\
**Post date:** [December 29, 2020, 6:01pm UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051/6 "2020-12-29T18:01:07Z")

</div>

> [@Jeannot\_Muller](#):
>
> Funny thing is that it took me years to remember where Xojo was _1-based_, but now I’m struggling sometimes to keep in mind that everything is now _0-based_

This remains a problem for me. My “other” two languages are _4D_ and _Python_. The former is one-based and the latter zero-based. _Xojo_ has a new method **FirstIndex** which is the companion to **LastIndex**. In API2, it always returns zero. Whether the use of this helps me or hurts me in terms of migrating my brain is not really clear. But it is available.

---

<div class="post-metadata">

**Author:** ![Jeannot\_Muller](https://forum.xojo.com/user_avatar/forum.xojo.com/jeannot_muller/32/13359_2.png) [@Jeannot\_Muller](https://forum.xojo.com/u/Jeannot_Muller)\
**Post date:** [December 29, 2020, 6:05pm UTC](https://forum.xojo.com/t/joe-strouts-arrayutils-module-conversion-to-api2/60051/7 "2020-12-29T18:05:52Z")

</div>

@Robert I hear you. But at least it is now always 0-based. It still confuses me sometimes too, especially when working in 1-based solutions. But the fact that Xojo was mixing both up for a very long time, drove me sometimes completely nuts. So it is at least some progress in my daily work ;-).
