Exit Statement

The exit statement allows you to break out of a routine (function or procedure). It passes the control to the first statement following the routine call.

Here is a simple example:

procedure Proc1();
var error: byte;
begin
  ... // we're doing something here
  if error = TRUE then exit;
  ... // some code, which won't be executed if error is true
end;
  Note : If breaking out of a function, return value will be the value of the local variable result at the moment of exit.
Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code