Misplaced Pages

GOSUB: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 12:50, 19 October 2011 edit67.149.219.128 (talk) Computed GOSUBTag: repeating characters← Previous edit Latest revision as of 01:35, 10 January 2021 edit undoApokrif (talk | contribs)Extended confirmed users, Pending changes reviewers28,429 edits Changed redirect target from BASIC to BASIC#Program flow controlTag: Redirect target changed 
(16 intermediate revisions by 14 users not shown)
Line 1: Line 1:
#REDIRECT ]
'''GOSUB''' is a command in many versions of the ] computer ]. A GOSUB statement jumps to a line elsewhere in the program. That line and the following lines up a RETURN are used as a simple kind of a ] without (sometimes with) parameters or local ].
]

{{R from subtopic}}
The GOSUB command may be used to emulate subroutines in a BASIC dialect that does not support subroutines in its syntax. GOSUB is convenient for performing the same function several times in a BASIC program without duplicating the code.<ref>{{cite web|url=http://www.qbasicnews.com/qboho/qckadvr.gosubr.shtml|title=GOSUB...RETURN Statement Details.|date=1988|accessdate=2008-07-04|author=|publisher=]}}</ref>
{{Rwh}}

== RETURN ==
A ] command resumes ] from the point at which GOSUB was invoked.

Using GOSUB too many times, as in a loop or recursively, without corresponding RETURN statements, would typically cause a ]. On the other hand, when the BASIC interpreter encounters a RETURN statement without a GOSUB it will emit a <code>RETURN WITHOUT GOSUB</code> error.

''''''== Computed GOSUB ==
now you know that you do not wont to really do this lol so bye bye i hope u have fun tryin to figure this out cuzz all this information is wrong!!!!!!!!!!!!!!!!!!!!!!!!!

== Support ==
Not all BASIC implementations support GOSUB or ON..GOSUB. For example, in ] GOSUB is considered as deprecated in favor of ]/FUNCTION, and is disabled by default.<ref>{{cite web|url=http://www.freebasic.net/wikka.php?wakka=KeyPgGosub|title=GOSUB|date=2008-05-08|accessdate=2008-07-04|author=|publisher=|quote="Gosub support is disabled by default in the -lang fblite unless the Option Gosub statement is used."}}</ref> In ], GOSUB and ON..GOSUB were removed when ] was released.

==See also==
* ]

==References==
{{reflist}}

{{compu-lang-stub}}
]

]

Latest revision as of 01:35, 10 January 2021

Redirect to:


  • With history: This is a redirect from a page containing substantive page history. This page is kept as a redirect to preserve its former content and attributions. Please do not remove the tag that generates this text (unless the need to recreate content on this page has been demonstrated), nor delete this page.
    • This template should not be used for redirects having some edit history but no meaningful content in their previous versions, nor for redirects created as a result of a page merge (use {{R from merge}} instead), nor for redirects from a title that forms a historic part of Misplaced Pages (use {{R with old history}} instead).
Category: