Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: a question about setting a local macro


From   Jian Zhang <[email protected]>
To   [email protected]
Subject   Re: st: a question about setting a local macro
Date   Fri, 3 Feb 2006 17:24:50 -0800 (PST)

Thanks, Maarten!  It really helps.

Jian

On Sat, 4 Feb 2006, Maarten buis wrote:

> Dear Jian Zhang:
> The /* and */ mean "ignore whatever is between", including returns. What happens in your case is
> that the start comment sign /* is now part of a string, so it is not evaluated as such. One way to
> solve this is to set the delimiter to ; before defining the local and set it back again to hard
> return afterwards. You can do that like this:
>
> #delim ;
> local i "prest_ p309_ p310_ p311_ p312_ p313_ p313c_
>                 p314_ p3141_ p3142_ p315_ p316_ p317_
>                 p318_ p3191_" ;
> #delim cr
>
> HTH,
> Maarten
>
> --- Jian Zhang <[email protected]> wrote:
> > Due to the lengh width limit of the do file editor, i have to continued
> > the command in the next line by using mark /*.  But it seems that when I used this
> > mark to define a local macro, it doesn't work.  For example,
> >
> > the command is as follows.
> >
> > local i "prest_ p309_ p310_ p311_ p312_ p313_ p313c_ /*
> > */ p314_ p3141_ p3142_ p315_ p316_ p317_ p318_ p3191_"
> >
> > stata returns with an error message saying invalid syntax.
>
>
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
>
> visiting adress:
> Buitenveldertselaan 3 (Metropolitan), room Z214
>
> +31 20 5986715
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
>
>
> ___________________________________________________________
> NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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