I would like to create a Macro that can take a variable number of arguments. Please note that the psuedo-program that I write below perhaps could bypass the need for variable number of arguments, but the point with the programe is to demonstrate my need (In reality it is a more complex program that I am writing). So the following program shows that I would like to create a function that can take arbitrary number of arguments and then sum them.
%Macro MyMacro(X1, X2, + ...);
sum = X1 + X2 + ... ;
%mend;
If I knew that I would like to sum only two numbers, it would be very easy:
%Macro MyMacro(X1, X2);
sum = X1 + X2;
%mend;
But I don't know how many numbers I want to sum (it depends), so the question is, how could I allow for an arbitrary number of arguments?
... View more