Skip to main content

ENDSUB | END SUB

Syntax


ENDSUB

ENDSUB or END SUB syntax are allowed

Description


ENDSUB terminates a SUB procedure

SUBs must be defined before they are called. 

Example


SUB sayHello
DIM I as
INTEGER ' this variable is local to the sayHello
SUB procedure

FOR I=1 to
3
PRINT
"Hello"
NEXT
I

ENDSUB
'...

MAIN:
'...
I =
55
PRINT I
' will display 55

GOSUB sayHello

PRINT
I
' will still display 55, as this is the global I, different from sayHello local
I

\

Differences from other BASICs

\

    • simplification of Visual BASIC
    • no equivalent in PBASIC

See also

\