Re: Procedure vs Function

new topic     » goto parent     » topic index » view thread      » older message » newer message
isaacbh said...

Hi, a newbie here. I've read in the docs that the return value of a function can be ignored. So, what's the real difference between a procedure and a function?

The difference is that a function must return a value and a procedure cannot return a value.

isaacbh said...

I mean, I can just use functions exclusively and put a return 1 statement at the end of functions that act as procedures. Is this the case?

You could, certainly, but others would regard it as poor programming practice.

Try to avoid the law of the instrument: learn to use each tool, and use each tool for its intended purpose.

-Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu