Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Use of subinword in Stata 13 vs. Stata 12


From   Chamara Anuranga <[email protected]>
To   [email protected]
Subject   Re: st: Use of subinword in Stata 13 vs. Stata 12
Date   Fri, 19 Jul 2013 21:05:44 +0530

Hi,

I don't know what happen with Stata 13 as still I don't have the
version. I also notice the problem and tried to figure it out.
I think for the second local generate, you should not use = sign.
Even you don't need to use it for the first local also as these are
string. I think when you mention the = that local tried to evaluate
and replace missing instead of space.
following command worked for me

local vlist="trunk"
local generate " "
dis subinstr("`vlist'","`generate'"," ",.)


Thanks,
Chamara



On Fri, Jul 19, 2013 at 8:50 PM, Dirk Enzmann
<[email protected]> wrote:
> Most likely I am suffering from temporary blindness, but I can't see my
> mistake:
>
> When trying to use -subinword()-, I get different results in Stata 13 as
> compared to Stata 12 (or 11, or 10). Example:
>
> * --- Start Stata commands: ---------------
>
> local vlist = "trunk"
> local generate = ""
> di subinword("`vlist'","`generate'"," ",.)
>
> * --- End Stata commands. -----------------
>
> Using version 13 the -display- command in the third line shows
>
> trunk
>
> (which I expect), whereas version 12 (or 11 or 10) shows
>
>
>
> nothing. Why does the replacement of the occurance of "" in "trunk" yields
> ""? And why does version 13 yield "trunk"?
>
> Dirk
>
>
> ========================================
> Dr. Dirk Enzmann
> Institute of Criminal Sciences
> Dept. of Criminology
> Rothenbaumchaussee 33
> D-20148 Hamburg
> Germany
>
> phone: +49-(0)40-42838.7498 (office)
>        +49-(0)40-42838.4591 (Mrs Billon)
> fax:   +49-(0)40-42838.2344
> email: [email protected]
> http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Enzmann.html
> ========================================
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index