Page 1 of 1

[Implemented] Arrays of any size inside structs

Posted: Mon Apr 25, 2005 2:59 pm
by Justin
some api calls fill structures with a pointer to an array of variable size, so being able to do this would be useful

Code: Select all

assuming the array is of longs

structure st
 *a.LONG[]
endstructure

then you pick up values,

var.st
x = var\a[100]\l

now you have to declare a structure with an array pointer larger enough, without really knowing how big can be the array

structure ALONG
  el.LONG[500]
endstructure

structure st
 *a.ALONG
endstructure

x = var\a\el[100]\l
or being able to declare arrays of any dimension from memory blocks anywhere in the code

Code: Select all

*a.SOMESTRUCT[10, 10] = allocatememory(sizeof(SOMESTRUCT)*100)