Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

Collection library

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2008, 04:12 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default Collection library

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.
Attached Files
File Type: zip Collections1.5.zip (35.1 KB, 130 views)

Last edited by agraham : 08-24-2010 at 08:28 AM.
Reply With Quote
  #2 (permalink)  
Old 01-30-2008, 05:09 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Thank you agraham

I'm sure that this library will be very useful for many of us.
Reply With Quote
  #3 (permalink)  
Old 01-30-2008, 05:45 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

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!
Reply With Quote
  #4 (permalink)  
Old 01-31-2008, 09:41 AM
Woinowski's Avatar
Senior Member
 
Join Date: Aug 2007
Posts: 105
Awards Showcase
Beta Tester 
Total Awards: 1
Default And Hashtable is something i was waiting for

Compliments, great idea to implemement these collections!
__________________
Unclutter your code -- use an obfuscator
Reply With Quote
  #5 (permalink)  
Old 05-28-2008, 01:51 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Source code for merging dll posted in original post.
Reply With Quote
  #6 (permalink)  
Old 09-02-2008, 05:43 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

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
Reply With Quote
  #7 (permalink)  
Old 09-02-2008, 07:23 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Thanks again
The online documentation is available here: Collections
Reply With Quote
  #8 (permalink)  
Old 04-27-2009, 05:43 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

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.

Last edited by agraham : 04-27-2009 at 06:05 PM.
Reply With Quote
  #9 (permalink)  
Old 06-13-2009, 06:24 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

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;
Reply With Quote
  #10 (permalink)  
Old 06-13-2009, 08:41 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I assume you are using something like

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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 11:23 AM
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 09:22 AM
Contact.update verschiebt Collection-List Paulsche German Forum 0 09-30-2008 11:08 PM
Data collection from devices to Desktop using SQLite mozaharul Questions (Windows Mobile) 3 04-03-2008 10:00 AM
3D to 2D functions collection legugusse Share Your Creations 2 07-12-2007 11:11 AM


All times are GMT. The time now is 10:22 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0