KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

arrayList, what is it?

 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Sat Oct 29, 2005 3:44 pm    Post subject: arrayList, what is it? Reply with quote

shawn, I see you have placed arrayList class in the .net package.
hmm...
it looks like array to me but it raises some questions.

how do you interact between it and the arrays returned by controls?

like, is this the kf.net equivalent for system.array?
can one fill this arraylist and push it to some control.
say, as a imagelist?

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Oct 29, 2005 4:35 pm    Post subject: Reply with quote

An ArrayList is a Collection (it inherits from CollectionBase) and it can contain anything you want. Strings, numbers, objects, whatever. Because its a collection, it responds to most of the same messages as any other collection (add,insert,remove,item,count,etc).

Can it be used with ImageList and other objects that supports Collections ?

Yes and no. You could (say) create an ArrayList of Images, but you can't plug that list directly into a ImageList (through the Images property). You would have to enumerate over the ArrayList and add them in one-by-one.

So what can you plug an ArrayList into ? You can plug an ArrayList into a control that supports the DataSource property (like a ListBox or ComboBox or (soon) a DataGrid) ... There are some limitations in terms of what you can do wiuth a plugged-in Arraylist (like editing the list - these are .net restrictions), but here is an example:

Code:

Break On

$System = CreateObject("Kixforms.System")

$Form = $System.Form()

$ArrayList = $System.ArrayList

For $i = 1 to 10
 $= $ArrayList.Add("Item-$i")
Next

$ListBox = $Form.Controls.Add($System.ListBox())
$ListBox.Center
$ListBox.DataSource = $ArrayList

$Form.Center
$Form.Show

While $Form.Visible
 $= Execute($Form.DoEvents)
Loop

Exit 1
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Sat Oct 29, 2005 9:17 pm    Post subject: Reply with quote

ja, like I was afraid, pretty useless Wink

for me anyways.

as never seen arraylist class before, thought you just renamed the good old array-class.
well...

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Oct 29, 2005 10:24 pm    Post subject: Reply with quote

well, maybe. But there is one very cool feature of the ArrayList that I didn't mention (and that isn't implemented yet) ... there is a builtin ultra fast SORT method for it - that alone would should make ArrayList kinda useful and cool, eh ? ;0)
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Sat Oct 29, 2005 11:03 pm    Post subject: Reply with quote

hmm...
the feeding of the arrayList is via add method and reading it is via for each so no, it's not cool.

if one does not want to use a sort udf, then, it can be useful but needs almost as much code to utilize...

hope someone finds it useful so you haven't done it in vain Wink

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Nov 02, 2005 2:16 pm    Post subject: Reply with quote

hehee..
found where you use it.

as example, doevents relies on it.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group