Re: Array of subroutines



Michael Metcalf wrote:

<snip>

call array (i, arg1, arg2, arg3)

and inside array:

subroutine array(index, arg1, arg2, arg3)
:
select case(index)
case(1)
call the_real_thing1(arg1, arg2, arg3)
case(2)
etc.

I would consider gathering arguments arg1, arg2, arg3 into a derived
type and making the derived type an argument of all the subroutines, so
that later one could effectively add or change arguments by changing
the components of the derived type.

.



Relevant Pages