User Tools

Site Tools


en:gosubreturn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:gosubreturn [2016/08/13 12:38]
admin
en:gosubreturn [2020/02/28 10:46]
Line 1: Line 1:
-===== Gosub ===== 
-==== Format ==== 
-**gosub** [[labelprogramsyntax|label]]\\ 
-\\ 
-label:\\ 
-[[programsyntax|statement(s)]]\\ 
-**return** 
  
-==== Description ==== 
-Jumps to the specified label.  Upon encountering a [[Return|Return]] statement the program will continue at the line following the Gosub.  Gosubs may call other gosubs but all variables are shared. 
-==== Example ==== 
- 
-<code> 
-a$ = "Hello" 
-gosub double 
-print a$ 
-b = 3 
-gosub triple 
-print b 
-end 
- 
-double: 
-a$ = a$ + a$ 
-return 
- 
-triple: 
-b = b * 3 
-return 
-</code> 
-will display\\ 
-<code> 
-HelloHello 
-9 
-</code>==== See Also ==== 
-[[goto|Goto]], [[Return|Return]] 
- 
-==== Notes ==== 
-As of version 0.9.9.2 [[goto|Goto]], [[gosubreturn|Gosub]], and labels can not be used in [[Function|Function]] and [[Subroutine|Subroutine]] definitions. 
en/gosubreturn.txt ยท Last modified: 2020/02/28 10:46 (external edit)