GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | RETURN

Edit History

RETURN

RETURN

Home > Reference > Language

RETURN {var|expr}

When used with GOSUB: Execution of the program branches to the command immediately following the most recent GOSUB command. RETURN is used without var or expr.

When used with FUNC: Set the return value of a function to the value var or the result of the expression expr.

Example 1: GOSUB

GOSUB my_routine
PRINT "RETURN sent me here"

END

LABEL my_routine
PRINT "I am in my routine"
RETURN

Example 2: Function

Result = MyAddFunction(10, 20)
print Result


func MyAddFunction(a, b)
  return a + b
end
Code samples using RETURN
001 3 ways to print hello 5 times.bas   002 numeric variables.bas   003 conditional branching.bas   2048.bas   3d_palmx.bas   3dtictac.bas   3dttt.bas   3dttt.bas   7gables.bas   agendus.bas   base64.bas   betrayal: crows ii.bas   bezier_pen.bas   biorythms.bas   blackjack.bas   BlackJack.bas   bolmo.bas   bopit.bas   Chaos_1xt.bas   Chaos_NPhase.bas   checkers.bas   chess.bas   circ.bas   colors1.bas   conrec-sb-v01.bas   crow.bas   cube3d.bas   dataminmax.bas   demanda.bas  
Language
AND   AS   BAND   BG   BOR   BYREF   CALL   CASE   CATCH   CONST   DECLARE   DEF   DO   ELIF   ELSE   ELSEIF   END   END TRY   ENDIF   EQV   EXIT   FALSE   FI   FOR   FUNC   GOSUB   GOTO   IF   IFF   IMP   IN   LABEL   LET   LIKE   LOCAL   LSHIFT   MDL   MOD   NAND   NEXT   NOR   NOT   ON   OR   REM   REPEAT   RETURN   RSHIFT   SELECT   STEP   STOP   SUB   THEN   THROW   TO   TRUE   TRY   UNTIL   USE   USG   USING   WEND   WHILE   XNOR   XOR  
This page was last edited on Fri, 7 Jul 2023 10:14:44 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.