RETURN

(Difference between revisions)
Jump to: navigation, search
(Action)
(Remarks)
Line 15: Line 15:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <span class="f_Header">Anmerkungen</span> =
  
Subroutines must be ended with a related RETURN statement.
+
Sub-Routinen und Interrupt-Service-Routinen müssen mit einem Return abgeschlossen sein.
 
+
Interrupt subroutines must also be terminated with the Return statement.
+
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>

Revision as of 13:11, 19 February 2013

Contents

Funktion

Rückkehr von einer Sub-Routine.

 

 

Syntax

RETURN

 

 

Anmerkungen

Sub-Routinen und Interrupt-Service-Routinen müssen mit einem Return abgeschlossen sein.

 

 

See also

GOSUB

 

 

Example


'-----------------------------------------------------------------------------------------
'name : gosub.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : demo: GOTO, GOSUB and RETURN
'micro : Mega48
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
 
$regfile = "m48def.dat" ' specify the used micro
$crystal = 4000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
 
Goto Continue
Print "This code will not be executed"
 
Continue: 'end a label with a colon
Print "We will start execution here"
Gosub Routine
Print "Back from Routine"
End
 
Routine: 'start a subroutine
Print "This will be executed"
Return 'return from subroutine

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language