IceChat Forums

IceChat 5 Scripting => Scripting => Topic started by: DarkStar on January 17, 2007, 10:44:01 PM

Title: Arrays!
Post by: DarkStar on January 17, 2007, 10:44:01 PM
I got questions... :)

1. Is there a limit to how many items an array can hold?
2. Is there a limit to how long a single item can be in an array?
3. Is it possible to remove an item from an array?
4. Is it possible to add an item to an array?

If yes to any of the above; How?

Moving on. If you have any tips/tricks for dealing with arrays, manipulating them, ect, Id be greatly apreciative. I just saw how a simple change by using an array cut a 100 kb INI file to 82 kbs. Im looking for more. :D
Title: Re: Arrays!
Post by: Snerf on January 17, 2007, 11:01:52 PM
1. not really, depends how big you want? 10,000 items. easy
2. nope
3. nope, gotta resize the array
4. again, gotta resize the array - try  "redim preserve array(100)"

No guarentees that works in vbs tho, thats how ya do it in vb6

But.. there are plenty of other objects, that do allow the above, like dictionaries and hash tables such.
VBS has the power to use a lot of these other thing, just have to do some research on em.