Re: Hard to find bug in my app
- Posted by jimcbrown (admin) Nov 08, 2009
- 941 views
Short version:
Function calls don't actually *require* you to receive the returned value. Is this expected and intended behavior? It resulted in a hard to find logic error for this newbie.
<snip>
Tried to track the error down over a couple of days. Last night finally figured it out. I was returning a value to the function, but my call to that function did not have a variable to receive the returned value. For example:
function colcheck() fin = TRUE end function ... some stuff colcheck() if fin = TRUE then exit() end if
Your example code contradicts your statement. In your example code, colcheck() does not return a value from the function. That should not work and if it ran, that is a bug.
However, functions can return values but the caller is not required to retrieve the value returned by the function. It can ignore the return value.