Sub Procedure vs Function

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Can anyone give the definative answer as to the
differance between a Sub Procedure and a Function

My answer is that a sub procedure accepts input values
whereas a function accepts input values and exports
values.
 
Paul said:
Can anyone give the definative answer as to the
differance between a Sub Procedure and a Function

My answer is that a sub procedure accepts input values
whereas a function accepts input values and exports
values.

Well either *can* accept input arguments, but that is required in neither.
The main difference is that a function returns a value.

Some people always use functions and in those cases where a return value is
not actually generated by the process have it return True/False merely to
indicate that the process ran successfully or not.
 
Can anyone give the definative answer as to the
differance between a Sub Procedure and a Function

My answer is that a sub procedure accepts input values
whereas a function accepts input values and exports
values.

Both Subs and functions can be passed arguments (input values) and can
manipulate those values, but the difference between the two is that a function
can return a value. Your answer was, essentially, correct.

:-)
 
Back
Top