Hi there, I'm trying to print the element of a binary search tree so i have the following procedures:
PROCEDURE bst_print_descending (root:node);
if (root <> nil) then
Canvas.TextOut (0,0 , IntToStr (root^.key)+ ' ['+ IntToStr(root^.level)+'] ');
procedure TForm1.DescendingOrder1Click(Sender: TObject);
Now, there seems to be a problem with the Canvas.TextOut; when i click the button to print the elements, the program gives me an error, something about access violation at address 00000000..
Now, i tried moving the Canvas.TextOut to the second procedure and it worked...The only problem is, to print all the elements in a tree i need a recursive procedure
Again, the error occurs when i call a procedure with Canvas action in it.... so anyone has any suggestions??