Re: Hard to find bug in my app

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...
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.

[/quote]

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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu