six demon bag

Wind, fire, all that kind of thing!

2011-01-02

A Wrapper Class for VBScript Arrays

Although VBScript does support arrays, their handling leaves a lot to be desired. To deal with the shortcomings of the built-in arrays (or rather, to avoid having to deal with them) I wrote CArray, a wrapper class that provides operations like inserting, appending and removing elements, getting slices (sub-arrays), sorting, etc.


Of course there's already stuff like System.Collections.ArrayList. However, I was aiming for something that a) wouldn't require .NET and b) could easily be used as a queue or stack as well as a "regular" array. See the API documentation for details.

If you want to use this wrapper class, either copy/paste the code to your script or import the class file.

Thanks to Alex for his feedback on the class interface.

Posted 03:23 [permalink]