*Item.StructureName = AllocateStructure(StructureName)Description
Allocates a new dynamic structure item. This dynamic structure item is properly initialized and ready to use, without the need to call InitializeStructure(). To access the structure data, a pointer associated with the specified 'StructureName' has to be used.
StructureName The name of the structure used to create the new dynamic item. The structure has to be already created.
The address of the new dynamic structure item, zero otherwise.
This command is for advanced users and shouldn't be needed for most of programs. It's often a better choice to use a structured array, list or map to store dynamic structured items.
FreeStructure() can be used to free the dynamic structure item. All dynamic structures are automatically freed when the programs ends.
If the program crashes at this command, it is usually a result of a memory corruption at an earlier time in the program by writing at an area outside of the allocated memory area. Such an error can be narrowed down to the real cause using the purifier debugger tool.
Structure People Name$ List Friends$() EndStructure *DynamicPeople.People = AllocateStructure(People) *DynamicPeople\Name$ = "Fred" AddElement(*DynamicPeople\Friends$()) *DynamicPeople\Friends$() = "Stef" Debug *DynamicPeople\Name$ Debug *DynamicPeople\Friends$() FreeStructure(*DynamicPeople)