Saturday, May 30, 2009

Dynamic Arrays

I have to shamefully admit... I didn't prepare anything for this week. I'd hate to post nothing, so instead I'll post something which I don't consider completely finished yet, but it's far enough along that it probably works just fine.


Working with arrays in classic ASP is frustrating. I wanted to make it more like working with listbox controls in Visual Basic. Note that I wrote this class before I started learning ASP.NET; I wanted to revamp it to bring it in line with the ArrayList class in VB.NET, but just haven't had time yet. More importantly, I haven't really had reason. All my current projects are in PHP or ASP.NET; I've essentially abandoned classic ASP. But I know there are people out there with classic ASP applications which they can't completely rewrite, so I intend to continue writing classic ASP functions.


Considering the enormous size of this class, there's no way I'm going to attempt posting it here, but it'll be on Snipplr as usual. Count, Item, and Items are implemented as properties. Subroutines and functions include: Remove, RemoveAll, Add, BinarySearch, Exists, Random, Reverse, Sort (calls QuickSort; also available are BubbleSort, CombSort, ExchangeSort, and SelectionSort), Shuffle, Swap, Sum, and Product.


View ASP implementation on Snipplr

No comments: