View Single Post
Old 12-12-2003, 02:27 PM  
Mr. T
Registered User
 
Join Date: Jun 2002
Posts: 62
Yea...not a really busy day at work today; so I'll explain why I did what I did.

1. I'm awesome...

No, but the thing to keep in mind is that storing large chunks of text in GUI "holders" in your case the textboxes is a bad way of managing resources. Every time you use another control, you are adding to the horrible GUI Beast's overhead. Even if the text boxes were off-screen, they still take up resources. And the more stuff you have painting on your forms the slower your app is going to be; especially if they're filled with lots of text/html!

So by using Collections, you now have a means to order and structure your data. And it's easy as sin to add/remove/count your resources!

If you didn't know already, the extensions of the Collection type are as follows:

Collection.Add - Adds to your collection
Collection.Remove(index) - removes the "nth" item from your collection (remember they're ordered 1-n, unlike normall arrays {0-n})
Collection.Count - returns the number of elements in your collection.
And finally Collection.Item(index) - returns the "nth" item in your collection.

So now that you've got this slick object to play with - I would suggest (since you're mailing) to use another collection (let's say Subjects) to manage all of your subjects so that you could randomize those as well!

Hope this little tutorial was worthwhile...I'd be happy to answer more questions while I'm bored.

Until next time,
Brad
__________________
Mr. T!
Mr. T is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote