Statalist


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

st: argument string with embedded comma


From   "Feiveson, Alan H. (JSC-SK311)" <[email protected]>
To   <[email protected]>
Subject   st: argument string with embedded comma
Date   Wed, 10 Dec 2008 13:17:01 -0600

Hi I know this has come up before, but I can't find it on the Stata
FAQ's or with -findit-. If a character string as an argument has a comma
embeded in it, how can I process it correctly? For example in -temp.do-,
below:


// temp.do
args a
noi di "`a'"


. run temp "ddfgdsf"
ddfgdsf
. run temp "ddfg,dsf"
option dsf not allowed
r(198);

But on the other hand, interactively:

. local blah "dsfgd,dsgdfg"

. di "`blah'"
dsfgd,dsgdfg

Why does this work interactively, but not as an argument in a .do file?

Al Feiveson




*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index