[IronPython] jagged arrays

Elise Langham (Elanit) i-ellang at microsoft.com
Wed May 27 16:30:36 CEST 2009

How do i create a jagged array in IronPython ?
I've tried various methods:

jagArray = Array[Array[int]]( ( (1,2), (1,2), (1,2,3), (1,2,3,4) ))

giving the error message: TypeError: expected Array[int], got tuple>


jaggedLengths = Array[int]((1,2,3,4))
cinit = System.Array.CreateInstance(int, jaggedLengths)
cinit[0][0] = 3

giving the error message: IndexError: index out of range: 0

Is there another method for creating arrays?
Many thanks,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090527/92b9dcfe/attachment.html>

More information about the Ironpython-users mailing list