Page 1 of 1

Array,List,Map of pointers of an undefined structure

Posted: Wed Apr 27, 2016 9:04 pm
by CSHW89
It is possible to define a pointer in a structure with an undefined structure. Thereby you can define cycle structures:

Code: Select all

Structure Main
  *pointer.SubStruc
  *noerror.ANonexistentStruc
EndStructure

Structure SubStruc Extends Main
  foo.i
EndStructure

test.Main
test\pointer\foo = 2   ; it works, because the structure is subsequently defined
; test\noerror\bar = 3 ; clear, compiler error, an undefined structure is used
But why doesnt work this with arrays/lists/maps:

Code: Select all

Structure Main
  Array *a.SubStruc(1) ; compiler error
  List *b.SubStruc() ; compiler error
  Map *c.SubStruc() ; compiler error
EndStructure

Structure SubStruc Extends Main
  foo.i
EndStructure

test.Main
AddElement(test\b())
test\b()\foo = 2
Is it possible to transfer this behaviour to arrays/lists/maps?
Thanks
Kevin