Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function bug ???
#1
Hi everyone

Found another possible bug in Naalaa 6 (windows version). Why these things always happen to me ? [Image: bug.png][Image: wink.png]
I was testing a simple function then i thought let's make a crazy thing... and program worked without any errors. Say what ?[Image: smile.png]





Code:
a=1
b=2

set color 0,0,0
cls

c=addnum(a,b)
set color 255,255,255
wln a,"+",b,"=",c


wln "press space to exit"
wait keydown
end

function addnum(a,b)
  c=a+b
  return c
  'what is this ? no error ? endproc in function ?
endproc
Reply
#2
Cool

 Reminds me of the time I forgot to end a procedure ( or function). It crashed my computer.

 Could have been NaaLaa5
Reply
#3
In NaaLaa the diference between a function and a procedure is that the latest doesn't return a value,
so my interpretetion is:

No matter if is a endproc or endfunc what metters in this case is the end of both and it must be a valid
endfunc or endproc, if you write just end or end what ever it will freeze you machine, just test in linux and frooze it.

Maybe it needs a better endfunc endproc error checking ending and endif also but this stuff is allways
easier to say then done....
Reply
#4
I'll fix this issue and the endif one. It's code I wrote ten years ago when playing around, and I guess I didn't test it for errors that much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)