Page 1 of 1

Linked List Detection

Posted: Tue Aug 09, 2011 8:17 pm
by Nexus100
Hi All & Thanks in advance!

I have an application that uses structures which contain linked lists. When the application is first started I want to Zero the structure data and the linked lists.

However it is possible that if this is the first time the procedure to zero the structure the lists have not yet been created.

Is there a way to check to see if the list exists?

I have tried the following:

Code: Select all

    If ListSize(Project\Planes()\PanelList()\PanelsBelow()) > 0
        ClearList(Project\Planes()\PanelList()\PanelsBelow())
    EndIf 
But this crashes if the list does not exist yet? Any help much appreciated!

Re: Linked List Detection

Posted: Tue Aug 09, 2011 8:40 pm
by flaith
You certainly have to call InitializeStructure first like

Code: Select all

InitializeStructure(*Pointer, Structure)
You'll find more explanations in the Help -> Various Topics -> Compiler Functions
Hope it will help you :wink: