Start from a main routine: Difference between revisions

{{header|ZX Spectrum Basic}}
({{header|ZX Spectrum Basic}})
Line 47:
 
* Click the OK button.
 
=={{header|ZX Spectrum Basic}}==
 
On the ZX Spectrum, there is no main function as such. However a saved program can be made to start running from a particular line number by providing the line number as a parameter to the save command. The following example will save the program in memory so that it starts running from line 500:
 
<lang zxbasic>SAVE "MYPROG" LINE 500: REM For a program with main code starting at line 500</lang>
 
{{omit from|Bc|Scripts start running from the top}}
Line 52 ⟶ 58:
{{omit from|C++}}
{{omit from|Dc|Scripts start running from the top}}
{{omit from|ZX Spectrum Basic|Programs runs from top (lowest line number), or a line number can be specified at run time}}
{{omit from|UNIX Shell|Scripts start running from the top}}