If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Help with doubly-linked list

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-14-03, 14:39
pdarcke pdarcke is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
Help with doubly-linked list

I'm working with Turbo Pascal 7, and I'm having an incredible time getting this to work. I have a doubly linked list, and I need to delete an entry from the middle.
In theory, I should be able to use

CurPtr^.Next^.Prev := CurPtr^.Prev;
CurPtr^.Prev^.Next := CurPtr^.Next;

right? This is how my teacher taught me to do it, and how the tutorials say, but even immediately after executing these statements, another procedure that traverses the list still finds the 'missing' record.

The traversal procedure has always worked before, and I can delete from either end of the list just fine. I have tried several different ways of doing this, and none of them work.

A rapid response would be greatly appreciated, as the end of the term is almost here.
Reply With Quote
  #2 (permalink)  
Old 12-14-03, 17:35
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
Red face

Take a pencil and paper and draw it out.

Put a soft piece of cloth in front of your forehead for when you slap it and say, "Doh!"
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On