User Tools

Site Tools


pt:gosubreturn

Differences

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

Link to this comparison view

pt:gosubreturn [2016/01/01 22:47] (current)
Line 1: Line 1:
 +===== Gosub =====
 +==== Formato ====
 +**gosub** //​etiqueta//​\\
 +\\
 +etiqueta:\\
 +//​statement(s)//​\\
 +**return**
  
 +==== Descrição ====
 +GOSUB faz o programa saltar para a //​etiqueta//​ . Quando encontra a instrução RETURN regressa de novo à posição original.
 +==== Exemplo ====
 +
 +<​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>​
 +mostrará\\
 +<​code>​
 +HelloHello
 +9
 +</​code>​==== Ver também ====
 +[[goto|Goto]],​ [[Return|Return]]
 +
 +==== Notas ====
 +As of version 0.9.9.2 [[goto|Goto]],​ [[gosubreturn|Gosub]],​ and labels can not be used in [[Function|Function]] and [[Subroutine|Subroutine]] definitions.
pt/gosubreturn.txt · Last modified: 2016/01/01 22:47 (external edit)