Statalist


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

Re: st: local macro query


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: local macro query
Date   Mon, 23 Jun 2008 09:49:17 -0400

Hello Daniel,

The "\" prevents macro from being evaluated, and thus includes the
reference, not the value into the local being defined. E.g.:

. local test "A \`B' C"
. di `"`test'"'
A  C

// ... later in the program ....

. local B "Zypsel"
. di `"`test'"'
A Zypsel C


Best regards,
  Sergiy Radyakin


On 6/23/08, H�chle, Daniel (MI Switzerland) <[email protected]> wrote:
> Dear all,
>
> For a program I would like to create several local macros containing strings of type "A `B' C". Later in my program the string "A `B' C" will be evaluated. Unfortunately, however, I don't manage to include single quotes in local macros. I fully understand that
>
>   . local Test "A `B' C"
>   . disp "'Test'"
>   A  C
>
> can't be the solution since local macro B is still empty.
>
> Thanks a lot for your suggestions in advance.
>
> Best regards,
> Daniel
>
>
>
>
> Any information in this communication is confidential and may be privileged or otherwise protected from disclosure without our consent. If you are not the intended recipient, you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. You are requested to please telephone or email the sender and delete this message and any attachment from your system.
>
> Due to the electronic nature of e-mail, there is a risk that the information contained in this message has been modified. Consequently we can accept no responsibility or liability as to the completeness or accuracy of the information.
>
> A-03-03-E
>
>
> *
> *   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