For an assignment i am trying to display particular values stored in a record structure (of type ternary tree). The data is read in from a text file. There is no input value, it simply displays 2 select values from the tree.
I am trying to test to make sure it isnt emtpy. If its not, i want to display the values and then move to the next branches and so on until the values are empty.
I am getting lots of errors though which i dont understand. Can anyone help?
procedure findPhrase (t:MelodyTree; n: integer);
writeln(' Phrases Stored In The Tree Are: ');
if (t^.title <> nil) and (t^.phrase <> nil) then
write('[', findPhrase(t^.title,n+1) '] : ', '"', findPhrase(t^.phrase,n+1) '"');
// Record Structure
type MelodyTree = ^TreeNode;
TreeNode = record