Class TForm1 (unit linklist) |
TForm
Constructors |
Functions |
Properties |
Events |
Variables |
Constructors |
Functions |
this procedure will add a new record to the linked-list.
This procedure will delete a record from our linked-list. The way this works is a little tricky until... first we check to see if our current pointer has a Prev ptr. If it does we then check to see if it has a Next ptr. If it does we set the Prev ptr's Next ptr to the Current ptr's Next ptr. Got that? :-) Otherwise we set the Prev ptr to nil. Then we do the same sort of check regarding the Next ptr vs. the Prev ptr so we can assign the Next ptr's Prev ptr to the Current ptr's Prev ptr... got that? Basically what we're doing is setting up to remove the Current record by assigning its Prev and Next ptr's to the records ahead and behind the Current record. Of course if there is no more records on one side or the other we set that side to nil. Once the pointers have been rearranged we're free to simply dispose of the Current pointer. Remember though that if your record contains OTHER pointers that have been allocated they need to be disposed of FIRST before you get rid of the Current Pointer!!!! Our example record does not have any of these so we don't have to worry about it
this procedure is a little obvious :-)
this procedure will move backwards through the list by stringing along the 'Next' pointers in the records. This of course can only go on until we get to the last record which will not have a Next pointer assigned
this procedure will move backwards through the list by stringing along the 'Prev' pointers in the records. This of course can only go on until we get to the first record which will not have a Prev pointer assigned
This procedure will update the data stored in our record as it is changed
This procedure will update the data stored in our record as it is changed
all this procedure will do is setup some default values for our pointers
This function returns a string representing the Hexadecimal address of the "Address" pointer passed as a parameter
This procedure adds new records to the linked-list. This is the central point of the linked-list management. If the list does not already exist the add procedure creates it. The 'CompAnchor' parameter passed is a pointer to the first element in the linked-list. This element will never change unless the list is entirely deleted.
This function is not really important, it merely shows visually what is going on with the linked-list
Properties |
Events |
Variables |
Private declarations