I've had this library lying around waiting for a help file for some time, so I've decided to get it done and out of the way.
The .NET platform implements several useful collection classes of which only ArrayList is included with Basic4PPC. This library adds some others, Stack, Queue, Hashtable and SortedList, that are very useful in some circumstances.
It requires .NET 2.0 and will run on both desktop and device. See the help file for further details.
EDIT : Source code for merging dll posted. Put it in the Basic4pp Desktop\Libraries folder.
EDIT:- Version 1.2 posted with enhanced array and ArrayList functions. Help, demos, library and source for merging are in the zip. See post #6 for details.
EDIT:- Version 1.3 posted with all the objects renamed with an 'Ex' suffix to avoid name clashes with Basic4ppc version 6.80 which implements Stack and Hashtable internally. See post #8 for further details.
EDIT:- Version 1.4 posted with culture sorting options added. See post #14 for details.
EDIT:- Version 1.5 posted with changes to suit Basic4ppc v6.90. See post #22 for details.
SortedList is very welcome to my current project, thanks Agraham...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Collections version 1.2 now posted with two additional objects, ArraysEx and ArrayListsEx.
Both ordinary arrays and the more specialised ArrayList are capable of some functions that are not exposed in B4ppc. This library now provides access to additional functionality for both.
The new ArraysEx object in the library allows you, along with some other things, to sort, search and copy normal arrays.
The new ArrayListsEx object in the library, along with some other things, lets you more easily transfer data between arrays and ArrayLists.
This library should work on desktop and device, but requires .NET 2.0
Version 1.3 now posted with all the objects renamed with an 'Ex' suffix to avoid name clashes with Basic4ppc version 6.80 which implements Stack and Hashtable internally. The Basic4ppc implementation of Stack is the same as StackEx but there are differences between Hashtable and HashtableEx. See the help file. Note the ArrayListsEx is now called ArrayListEx for reasons of personal whim!
Minor changes are that all ControlRefs now support getting and setting a control reference and StackEx, which implements some strongly typed methods, now has a PeekType method to determine the type of the item on the top of the stack.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Hello Agraham.
please,add new method to ArrayEx object- ToString(Array() as array,Separator as string)
Yes,i can do it in basic with small cod but i have big array...and it is slow. I think this cod in library will be faster
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
For i = 0 to Arraylen(array())
Str = Str + array(i) + separator
Next
This will be slow using strings. Try using a Stringbuilder from my StringsEx library, that should be a lot quicker. New it with a reasonably large capacity so it doesn't have to grow itself too often.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.