in PB-helpfile I can only read about "pointer to the element". But in PB "pointer to the element" is not "pointer to the element". The commands ChangeCurrentElement() and SwapElements() use the "pointer to the data of the element" and all other commands return the "pointer to the element". This information is very fundamental to use LinkedLists without problems. Look at my abstract:
Code: Select all
Follow commands returns the "ElementPointer":
------------------------------------------------
*ElementPointer = AddElement(linkedlist())
*ElementPointer = FirstElement(linkedlist())
*ElementPointer = InsertElement(linkedlist())
*ElementPointer = LastElement(linkedlist())
*ElementPointer = NextElement(linkedlist())
*ElementPointer = PreviousElement(linkedlist())
Follow commands use the "ElementDataPointer"
------------------------------------------------
ChangeCurrentElement(linkedlist(), *ElementDataPointer)
SwapElements(linkedlist(), *ElementDataPointer, *ElementDataPointer)
How can I get the "ElementDataPointer"?
------------------------------------------------
*ElementDataPointer = *ElementPointer + 8 (from ElementPointer)
*ElementDataPointer = @linkedlist() (or from current element)
-8 | Pointer to next element (= *ElementPointer)
-4 | Pointer to previous element
0 | Begin of data in the element (= *ElementDataPointer )
...| .... and more data
Solution 2) Or the easy way: update the helpfile and be accurate with the description "pointer to the element". Characterise the construction of an element detailed.