Re: Hard to find bug in my app
- Posted by DanM Nov 10, 2009
- 886 views
justaguy said...
Yes, sorry, I got interrupted while I was typing it in.
I tried
function colcheck() fin = TRUE end function ... some stuff colcheck() if fin = TRUE then exit() end if
and the interpreter gave me an error.
when I changed
fin = TRUE
to
fin = TRUE return fin
The interpreter was happy.
I suspected nothing required you to actually assign the return value, but wasn't sure.
Thanks.
It looks like your fin var is NOT a local var to the function? Probably not a good idea, but if so, you wouldn't really have to return IT, just NEED (always!) to have SOME "return" statement in every function; so, in your example, "return 0" would have worked too, I think, since the var, after being assigned a value in the function, could be seen outside the function whether returned or not.
DanM