| Posted: 11:02pm 17 Mar 2026 |
Copy link to clipboard |
 Print this post |
|
I have been programming in PicoMite BASIC 6.02 and really enjoy it. I've been experimenting with the new STRUCT's and find them powerful. I find that arrays of STRUCTs inside a STRUCT don't behave as I am expecting;
TYPE KeyLink Link AS INTEGER Key AS STRING LENGTH 15 END TYPE
TYPE Tree TreeD AS INTEGER KeyLinks(20) AS KeyLink END TYPE
DIM T as Tree, KL AS KeyLink DIM L as INTEGER, K as STRING
This works, but there are couple things that don't work the way I expect based on my experience with other languages. When declaring an array outside of a STRUCT, you can define a CONST and use that to define the array size, but inside a STRUCT (KeyLInks), it seems like. you have to use a number.
It seems like you can't use a subscript to access a KeyLinks member:
KL = T.KeyLinks(10)
This always seems to assign the value off T.KeyLinks(0) regardless of the subscript, but code like
L = T.KeyLInks(10).Link K = T.KeyLinks(10).Key
Seems to work as expected. |