Start from a main routine: Difference between revisions

Content added Content deleted
(Start from a main routine in various BASIC dialents (BASIC256, QBasic, Run BASIC, True BASIC and Yabasic))
Line 65: Line 65:
print "Hello World!"
print "Hello World!"
}</lang>
}</lang>

=={{header|BASIC}}==
==={{header|QBasic}}===
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
QBasic does not require an executable program to have a main() procedure.
However, there's nothing to stop you creating one and then calling it to start the program:
<lang qbasic>SUB main
PRINT "Hello from main!"
END SUB

main</lang>

==={{header|BASIC256}}===
BASIC256 does not require an executable program to have a main() procedure.
However, there's nothing to stop you creating one and then calling it to start the program:
<lang BASIC256>subroutine main()
print "Hello from main!"
end subroutine
call main()</lang>

==={{header|Run BASIC}}===
Run BASIC does not require an executable program to have a main() procedure.
However, there's nothing to stop you creating one and then calling it to start the program:
<lang lb>sub main
print "Hello from main!"
end sub

call main</lang>

==={{header|True BASIC}}===
{{works with|QBasic}}
True BASIC does not require an executable program to have a main() procedure.
However, there's nothing to stop you creating one and then calling it to start the program:
<lang qbasic>SUB main
PRINT "Hello from main!"
END SUB

CALL main
END</lang>

==={{header|Yabasic}}===
Yabasic does not require an executable program to have a main() procedure.
However, there's nothing to stop you creating one and then calling it to start the program:
<lang yabasic>sub main()
print "Hello from main!"
end sub
main()</lang>


=={{header|C}}==
=={{header|C}}==