> > if not fileExists(edit1.text) then raise exception.create('No such path > or filename'); > modalresult:=mrOk; > end; >
Why would you need to raise an exception here? Why not just open a dialog? Isn't the usual way to handle exceptions with try-except blocks? The idea is that you can interrupt the program's normal flow of control by catching exceptions and performing special handling in those cases, and moving back to an earlier point in the routine or call stack. If you are checking a condition explicitly and the flow continues from there, then I don't see the need for the raise. Seems like a waste of resources.