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]

st: RE: replace-all can crash do-file


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: replace-all can crash do-file
Date   Sat, 15 May 2010 11:47:20 +0200

<>

So I create a file in my do-file editor for Stata 11 that reads

***********
this is a text containing hh. hh is a prominent word.
***********

and have Stata replace "hh" with "hh_id" and it cycles through the thing
once, just as it should. The problem does not occur for me, either. Stata
tech support should be your next stop, I think.


HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Hewan Belay
Sent: Samstag, 15. Mai 2010 05:59
To: Stata List
Subject: st: replace-all can crash do-file

Dear Statalist,

I couldn't find any reference to this issue in the archives, though I am
sure it must have already afflicted many. 

It appears that the find-and-replace option in the Stata 11 do-file handles
"replace all" (e.g. when you do CTRL+H) in a way that can crash the
do-file--and lead to exasperating loss of data if one hasn't saved the file
in some while. It seems that when using "replace all", for example when
replacing all "hh" with "hh_id", it never stops replacing, thus creating
hh_id, then hh_id_id, etc., leading to a do-file freeze then crash. If not
clear what I mean, give it a try! Even Notepad is more intelligent and only
searches once through the document when using "replace all". 

I try to be careful about using "replace all" in stata (e.g. in the above
example, replacing all "hh" with "house_id" would not cause a crash), but
it's easy to forget that it won't stop looping, and face an unpleasant
do-file crash. Is there any setting I can change to avoid this behaviour in
do-files?

Thanks,
Hewan



      
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index