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:

sub procedure Proc1()
dim error as byte
  ... ' we're doing something here
  if error = TRUE then
    exit
  end if
  ... ' some code, which won't be executed if error is true
end sub
  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