Posted: Sat Apr 14, 2018 10:49 pm Post subject: Exit a subroutine early
I want to leave a subroutine early (before the final "end sub")
Here is what did not work for me:
I call a subroutine named "somesub".
Code:
sub somesub()
In the subroutine I perform some comparisons. If the comparisons are true, I want to leave the subroutine early so I don't waste time.
The compiler doesn't like it.
Code:
sub somesub()
blah
if a = b then do this
do that
endsub'this is line 141 with error 123 end if
blah
blah
endsub
I get this error when trying to compile
Error : 123 Line : 141 END IF expected
Evidently the compiler wants "if".... and then "end if" with no intermediate "end subs"
Evidently the compiler wants "sub".... and then "end sub" with no intermediate "end subs"
I am sure this is an easy fix and many have done it, but have not found on forum when I did search on "leave subroutine early" etc
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum