Question about IntArrayList
Monkey Forums/Monkey Programming/Question about IntArrayList
| ||
I am trying to load a int[] into an IntArrayList. Is there a way to do this? I tried .FillIntArray([34,23,45]), but it doesn't work. I want to be able to add something like this "[23,34,67]" to the IntArrayList. How would I easily do this? |
| ||
IntArrayList??? It isn't a Monkey native object, right? Are you using a 3rd party module and if yes, from which one is it? |
| ||
Diddy's IntArrayList |
| ||
Maybe you should tag the topic title accordingly. Like "Diddy: Question about IntArrayList". |
| ||
I'm in the process of reworking ArrayList slightly such that you can just use ArrayList<Int> and it won't use any boxing. This should be a lot faster and will let you do the kind of thing you want. Currently working on some other projects though. |
| ||
I am trying to load a int[] into an IntArrayList. Is there a way to do this? Yep, just loop thru the array and add them to the IntArrayList: Strict Import diddy Function Main:Int() Local intArray:Int[] = [30,22,44,55] Local intArrayList:IntArrayList = New IntArrayList For Local i:Int = 0 Until intArray.Length Print intArray[i] intArrayList.Add(intArray[i]) Next Print "---------" For Local i:Int = Eachin intArrayList Print i Next Return 1 End |