Here ya go, there were a few mistakes in there, but I commented on anything that I fixed.
CUBE_NUM=1 `#1, an object cant be numbered 0, and can be a regular variable.
`FUNCTIONS MUST GO AFTER THE MAIN LOOP, other wise it will say:
`YOU HAVE HIT A FUNCTION DECLARATION MID-PROGRAM!
`You dont need to type a ; at the end of a line. only if you intend to add a different line of
`code to the end of that line. example:
X_ang as float `a variable needs to be a Float for it to contain a decimal
Y_ang as float
`IS THE SAME AS
`X_ang as float ; Y_ang as float
`main
startup()
Make object cube CUBE_NUM,100
`MAIN LOOP
while not escapekey()
`Copied the animate() function into the main loop
`The function wouldnt work, because it's variables only exist within this function.
`so everytime the function was called, the angle values started at 0.
if leftkey()=1
Y_ang=wrapvalue(Y_ang+0.1)
text 16,16,"left pressed"
endif
if upkey()=1
X_ang = wrapvalue(X_ang+0.1)
text 16,32,"up pressed"
endif
rotate object CUBE_NUM, X_ang, Y_ang, 0.0
sync
endwhile
`END MAINLOOP
`********************************************************
function startup()
`set some basic options
sync on
sync rate 60
set text size 16
set display mode 640, 480, 32
endfunction
`********************************************************