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: length of a returned local using rclass


From   Miranda Kim <[email protected]>
To   [email protected]
Subject   Re: st: length of a returned local using rclass
Date   Tue, 06 Apr 2010 11:59:20 +0100

Thank you all for your replies to this.
I had not enclosed r(macro) in single quotes when displaying its content to check, as Antonis refers to in his response.
Thanks a lot for your help with this.
Best wishes,
Miranda



Martin Weiss wrote:
See also Nick's http://www.stata-journal.com/article.html?article=pr0045
HTH
Martin

-original message-
Subject: Re: st: length of a returned local using rclass
From: Ulrich Kohler <[email protected]>
Date: 06-04-2010 12:01

Am Dienstag, den 06.04.2010, 10:46 +0100 schrieb Miranda Kim:
Hello,
When writing a small program that saved a string (list of variables) using -rclass- and -return local-, the list was prematurely truncated. I therefore wonder if there a limit to the number of characters that can be stored in a local macro using rclass, or if I should be looking for a bug in my code?


Depending on the version of stata that limit is between 8,681 in Small
Stata and 1,081,511 in Stata SE/MP. In Intercooled Stata it is 165,200 (see -help limits-).
A frequent reason for truncated strings is the use of equal signs during
macro definition. Equal signs call the expression calculater, which
truncates string down to the maximum length of strings in expressions
(i.e. 244). Perhaps you may want to code

. return local varlist "`varlist'" instead of
. return local varlist = "`varlist'"


Many regards
Uli


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



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