Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: passing indefinite no of arguments


From   tashi lama <[email protected]>
To   <[email protected]>
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 

*sum

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... 



Thanks, 

Tashi  		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index