Return Statement

The return statement causes execution to leave the current subroutine and resume at the point in the code immediately after the subroutine call.
It's mainly intended to be used with gosub statement.

Here is a simple example :

sub procedure Proc1()
dim error as byte
  ... ' we're doing something here
  if error = TRUE then
    return
  end if
  ... ' some code, which won't be executed if error is true
end sub
  Note :

Return statement should NOT be used for exiting functions or procedures, because it does not handle stack and return value.
In such cases exit statement should be used.

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