List of typed pointers
Posted: Sun Jun 14, 2020 10:31 am
I didn't know this feature... but experimenting shows it's working.
Normally a list handles its structures itself. An assignment makes a copy of the structure. Here we just pass pointers directly, saving memory etc.
So basically a typed pointer list. Better than using a generic .i list.
Normally a list handles its structures itself. An assignment makes a copy of the structure. Here we just pass pointers directly, saving memory etc.
Code: Select all
EnableExplicit
Structure Test
Name.s
EndStructure
Define a.Test
a\Name = "Test"
NewList *l.Test()
AddElement(*l())
*l() = a ; assign a memory reference
Debug @a\Name
Debug @*l()\Name ;same address
Debug *l()\Name