While trying (unsuccessfully
) to reproduce an incorrect line number error message on the following thread
http://forum.thegamecreators.com/?m=forum_view&t=75242&b=15
I encountered the following strange bug:
set display mode 1024, 768, 32
sync on: sync rate 0: sync
autocam off
position camera 0, 50, -300
point camera 0, 0, 0
make object cube 1, 50
global cx#
global cy#
cx# = camera angle x()
cy# = camera angle y()
remstart
` this is several lines of commented out code
` followed by a line with a deliberate error in it
for i = 2 to 20
make object sphere i, 50
position object i, rnd(200)-100, rnd(200)-100, rnd(200)-100
next i
` and this is another comment
` rremend
` remend
` this program compiles when it probably shouldn't
` whereas if you uncomment the remend it won't compile !!
print "will this print?"" - probably not"
` well actually it does :)
sync
wait key
repeat
text 20, 20, "cam X angle = "+str$(camera angle x(),2)
text 20, 40, "cam Y angle = "+str$(camera angle y(),2)
positionCamera()
sync
until spacekey()
end
function positionCamera()
control camera using arrowkeys 0, 1, 0
cx# = cx# + mousemovey(): cy# = cy# + mousemovex()
rotate camera cx#, cy#, 0
endfunction
This bug has caused me a bit of pain when debugging programs using remstart/remend pairs.