Explanation:
 
The value of the #scan variable can be used not just in comparisons (if value #scan <> 0 then ...) but also as targets in goto statements.