Hi MSX,

I don't think that one of this is faster than the other.
Maybe the procedure is a little bit faster, because it directly writes into the variable you give it. The function has to store the result and then copy it to the variable.

Both have advantages for themselves, depending on what you want with that function/procedure.
When implementing the procedure, you ALWAYS have to use a variable which stores the result. A function can do the same as the procedure, but it is not necessary to always process the result (maybe the function only results true or false for success), you can call it without processing the result, so in my opinion it's a little more "flexible".

"Me, myself and I" always use function when I need ONE result, no matter if it is a value to be processed or only a boolean result like successful/unsuccesful.
When more than one variable has to be processed/manipulated I use a procedure and give the variables to it.

To come back to your example: In my opinion, this is a classic example for a FUNCTION. No one I know would code this in a procedure.

Regards,
Dirk