Can somebody enlighten me to the difference between these codes?
I'm putting a Map of structure "myStruct" inside a structure "myStruct" in order to create endless nestable data structures like graphs, for example.
The following code works as expected.
Code: Select all
Structure myStruct
string.s
Map test.myStruct() ;
EndStructure
Define myVar.myStruct
myVar\string = "Hello World"
myVar\test("Test 1")\string = "Hello Test 1"
myVar\test("Test 1")\test("Test 2")\string = "Hello Test 2"
Debug myVar\string
Debug myVar\test("Test 1")\string
Debug myVar\test("Test 1")\test("Test 2")\string
Now I want to do the same thing with arrays in order to identify a "child-node" by a number instead of a string.
Code: Select all
Structure myStruct
string.s
Array test.myStruct(10)
EndStructure
I'm curious.---------------------------
PureBasic
---------------------------
Line 3: Can't do it, it would cause endless recursivity.
---------------------------
OK
---------------------------
What is the difference between a Map and an Array that causes the "same" code to function properly and to throw an error like this?