Linked List Detection

Just starting out? Need help? Post your questions and find answers here.
User avatar
Nexus100
User
User
Posts: 55
Joined: Tue Feb 16, 2010 9:40 pm
Location: Essex, UK

Linked List Detection

Post 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!
All watched over by MACHINES..I am little more than #DigitalPlankton
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Re: Linked List Detection

Post 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:
“Fear is a reaction. Courage is a decision.” - WC
Post Reply