miércoles, 15 de abril de 2015

GOSUB && CALL SCM



Difficulty: Easy

What is GOSUB?  What is CALL SCM function?
How do we use them properly?

GOSUB 

gosub is a sub-process that normally we use, when we want to hide some action in the code.  It takes all the variables used in the thread.
the gosub has this form:
gosub @sub_routine

:sub_routine
{code}
return

the code will automatically jump to the :sub_routine Label, when the job is done, will return to the same point.

to understand better, I'll show you some examples: