Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: passing indefinite no of arguments

From   tashi lama <>
To   <>
Subject   st: passing indefinite no of arguments
Date   Fri, 30 Mar 2012 18:43:16 +0000

Hello all,  

     Could someone give me an idea or give me a lead on this problem.        

So, say I have a do file which will add the arguments and display 


args a b c d

di `a' +`b'+`c'+`d' 

This one is easy since I could pass 4 arguments a, b, c and d and my do file will sum them. What if I don't know the no of arguments I am passing? I could have passed 2, 3, 5 or even 1 and find their sum. 

How would you pass the arguments and code? Any help will be highly appreciated... 


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index