GOSUB/de
(Difference between revisions)
(→Funktion) |
(→Remarks) |
||
Line 15: | Line 15: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Anmerkungen</span> = |
<div style="padding: 0px; margin: 0px 0px 0px 4px;"> | <div style="padding: 0px; margin: 0px 0px 0px 4px;"> | ||
{| width="488" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | {| width="488" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;" | ||
Line 23: | Line 23: | ||
| valign="top" width="100%" style="width: 385px; border: 1px solid rgb(0, 0, 0);" | | | valign="top" width="100%" style="width: 385px; border: 1px solid rgb(0, 0, 0);" | | ||
− | + | Der Name des Labels zu dem verzweigt wird. | |
|} | |} | ||
Line 29: | Line 29: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | + | Mit GOSUB, springt der Programmablauf zu dem angegebenen Label und führt den nachfolgenden Programmcode aus. | |
− | + | Trifft die Programmausführung auf den Befehl Return, wird wieder mit der Ausführung des Programms nach dem Aufrufenden GOSUB fortgefahren. | |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> |
Revision as of 09:34, 19 February 2013
Contents |
Funktion
Verzweigt zu einer SUB-Routine.
Syntax
GOSUB label
Anmerkungen
Label |
Der Name des Labels zu dem verzweigt wird. |
Mit GOSUB, springt der Programmablauf zu dem angegebenen Label und führt den nachfolgenden Programmcode aus.
Trifft die Programmausführung auf den Befehl Return, wird wieder mit der Ausführung des Programms nach dem Aufrufenden GOSUB fortgefahren.
See also
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 |
---|