Introduction to OOP | Chapter 19: Container Classes : | next | previous | audio | real | text |
Consider the conventional solution:
var aList : List; (* the list being manipulated *) p : Link; (* a pointer for the loop *) begin ... p := aList.firstLink; while (p <> nil) do begin writeln (p.value); p := p^.nextElement; end;Needed to expose the link type, and the field nextElement.