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, statalist.org is already up and running.


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

st: Varname default in a program


From   Dani Tilley <tilleydani@yahoo.com>
To   stata <statalist@hsphsun2.harvard.edu>
Subject   st: Varname default in a program
Date   Fri, 9 Jul 2010 11:16:13 -0700 (PDT)

Hi,

I'm trying to write a program that will have the following syntax

syntax varlist(min=1 max=5), [Pvar(varname)]

However, I want the to have a default value for pvar so that when users say 
-command var1 var2- the program returns no error and uses the default variable 
for pvar. I know how this is done for numeric variables but can't do it in this 
context. I tried [Pvar(varname default)] where default is a variable but got 
r(197).

Any help is appreciated.

DF Tilley



      
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index