www.lucersoft.com

   
       Home  |   News  |   Downloads  |   Order  |   Contacts

 

 

Main

Home

Site map

Products

LC Backup

LC Copier

HTML Batch Editor

HTML Batch Editor PRO

Tennis 2001

Freeware

Documentation

HTML Batch Editor PRO

LC Basic

Information

Order

Update Policy

Support

Contacts

Links

 
 
 
 

 
 
 
 
 
 
 
 
 

GoSub ... Return

Language reference


Syntax

 

GoSub label
...
label
...

Return


Description:

 

GoSub Branches unconditionally to a specified label subroutine and returns back on the Return statement. A subroutine can contain more than one Return statement, but the first Return statement encountered causes the flow of execution to branch back to the statement immediately following the most recently executed GoSub statement. If you use Gosub ... Return subroutine, you must ensure that a program is terminated before label subroutine. See example.


Examples:

a = 10: b = 20:greater = "I don't know :-)" 
Gosub MAX
MsgBox "Greater is " + greater
End

MAX:
If a>b: greater = "a"
Else:   greater = "b"
Endif

Return

 


See also:

 

label, GoTo


A Gosub statement is a part of kernel LC Basic.

 
Last updated: November 2, 2003
Copyright © 2002 Lucersoft

Add to favorites

Back