How to break out of a recursion?



I'm just playing around with implementing a backtracking algorithm
recursively, and what I want is for the program to terminate (with an
appropriate output) the moment a solution is found.  return() doesn't do
this, but error() does, if inelegantly.  Is there any other way of forcing
the termination of a program other than with error()?

Thanks,
Alasdair

-- 
Blog: http://amca01.wordpress.com