So if there's no white space at the end of your program, just...
main:
code...
more code...
even more code...
ENDbefore your subroutine, afterwards there will be:
main:
code...
more code...
even more code...
// ------------------------------------------------------------- //
// --- MYSUBROUTINE ---
// ------------------------------------------------------------- //
SUB ShowPlayField:
ENDSUB // MYSUBROUTINE
ENDwhich fails to compile with this error:
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.8.044 SN:1c15d767 - 2D, WIN32
"OneMore.gbas"(41) error : command not inside function or sub
Quote from: Moru on 2010-Sep-08
Make your program like this:
Main:
Loop
End
Everything after this line has to be functions or data:
Function x:
endfunction
Yes. If your last line is "END" and you use the "Sub" button to create a new subroutine, it will place it BEFORE your last line, not after it. The Sub button is prone to CAUSING the errorm which might fox newbies.