Statalist


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

Re: st: Re: Two-word commands with gettoken


From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: Re: Two-word commands with gettoken
Date   Mon, 9 Mar 2009 10:13:09 -0400

Hi, Nick,

I am not sure what can be good about it. A space that separated subcmd
from the rest remains with the rest anyways and adding another will
double it:
local 0 `"foo "bar""'

. gettoken subcmd 0: 0

. di `"[`0']"'
[ "bar"]

. local 0 `subcmd' `0'

. di `"[`0']"'
[foo  "bar"]

Regards, Sergiy



On Mon, Mar 9, 2009 at 6:14 AM, Nick Cox <[email protected]> wrote:
> An extra space will do no harm and might do good.
>
> local 0 `subcmd' `0'
>
> Nick
> [email protected]
>
> Sergiy Radyakin
>
> after -gettoken- the local `0' does not contain `subcmd' anymore, so
>
> 1) just put it back there:
>
> gettoken subcmd 0: 0
> local 0 `"`subcmd'`0'"'  // <<<---- new line
> if ....
>
>
> *
> *   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/
>

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