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

RE: st: local macro query

From   "Nick Cox" <>
To   <>
Subject   RE: st: local macro query
Date   Mon, 23 Jun 2008 16:48:49 +0100

Sergiy's work-around is clever, but my answer to this is more elementary: as a matter of style, don't define things before you have all the information you need. I'd be interested to know if Daniel has a problem in which that approach is not applicable. 


Sergiy Radyakin

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

On 6/23/08, Höchle, Daniel (MI Switzerland) <> wrote:

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

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index