Re: Proper way to return a string



In article <slrnep5g8k.3020.Jeremy@xxxxxxxxxxxxxxxxxxx>,
Jeremy <my-first-name@xxxxxxxxxx> wrote:

I guess I am still trying to understand when I should use a function
and when I should use a subroutine with inout/out parameters.

You may get lots of opinions, but here is how I make my choices.
Basically, if you expect that expressions like

a = fun(arg) + fun(arg)

are useful, and if the functions don't have side effects or perform
i/o operations that make this illegal, then functions might be the
best choice. But if you always expect only a single function call
per statement, if the function has side effects (including changing
the value of its argument), or if the function does i/o (which is
problematic in some contexts), then you are probably better off with
a subroutine. If there is any doubt about any of these things
(including future use of the subprogram by you or other
programmers), then you should probably use a subroutine.

$.02 -Ron Shepard
.