Hello JAW,
Let me be the first to welcome you to the forums and the DBC board.
When posting code please put it in a code box (the simplest way to do this is to highlight your code and click the code button).
hide mouse
make object plain 101,5000,5000
xrotate object 101,270
color object 101,rgb(200,0,0)
make object box 201,100,100,100
do
gosub _control
gosub _exit
loop
end
_control:
if keystate(203)=1
move object 201,10
if keystate(200)=1
yrotate object 201,wrapvalue((object angle Y(201)) - 5)
if keystate(205)=1
yrotate object 201,wrapvalue((object angle Y(201)) + 5)
endif
return
_exit:
if Inkey$()="q"
cls : END
endif
return
I've indented your code for you - if you post in code boxes your indenting will be maintained but post in normal text and the forum will "correct" your spacing.
You must close every IF with an ENDIF, unless you use IF... THEN... which tells DB that it's a one line IF statement: everything on that line is part of the statement and the statement ends when the line ends.
Now the code is indented you can clearly see where the missing ENDIF's should be in the _control subroutine, the indentation gradually steps in then jumps out three levels! We need ENDIF's to breach the gap and close those IF statements.
Good on you for using subroutines so early by the way

, I ignored them for far too long!

Everything worthwhile requires effort.