![]() Test(12345) = 123 everything fine Else Debug "Array 'Test()' couldn't be initialized."ĪrrayStatic.l Static array, only in structures Array ArrayDynamic. If the array isn't yet declared (or its allocation has failed), it will return -1.Īs specified with Dim, the number of elements is equal to the size + 1.įor example: Dim a(2) contains 3 elements from a(0) to a(2) for a size of 2.ĭoes not work with static arrays declared in Structures.ĭebug ArraySize( MyArray()) will print '10' Dim MultiArray.l(10, 20, 30)ĭebug ArraySize( MultiArray(), 2) will print '20' Dim MultiArray2.l(2,2,2)ĭebug MultiArray2(0,0,0) will print '1' Debug MultiArray2(0,1,0) will print '2' Debug MultiArray2(0,2,0) will print '3' Debug ArraySize( MultiArray2(),2) will print '2' ![]() On other hand, it provides a very fast direct access to a random element. Therefore, it's not possible to easily insert or remove an element. ![]() Unlike a list or a map, the elements are allocated in a contiguous manner in memory. If I use 1 I get also the correct size, but I can not access 2 for example. PureBasic - Array Overview Arrays are structures to store indexed elements. It is one of the most flexible languages, as modification can easily be done in already existing program. If I remove the 0 I get the right structure size, but I can not access the arrays in an easy way. Returns the size of the array, as specified with Dim or ReDim.įor multidimensional arrays, this parameter can be specified to get a specific dimension size. It is widely known and accepted programming language.
0 Comments
Leave a Reply. |