Statalist


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

st: How do I get more than 244 characters into my return local macro?


From   "Kim Lyngby Mikkelsen (KLM)" <KLM@arbejdsmiljoforskning.dk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: How do I get more than 244 characters into my return local macro?
Date   Thu, 22 Nov 2007 15:42:00 +0100

In the Stata 10 Programming manual, under 'return' it says:

Be careful with this syntax: do not code
	return local name = `mymacro'
because that will copy just the first 244 characters of `mymacro'. Instead, 
code
	return local name `"`mymacro'"'

I have tried either way, but I am not able to copy more than 244 characters 
into my returned local macro.

Am I doing something wrong, or is there a workaround this limitation?
(I am using Stata/SE 10 for Windows).

A part of my code is given below.
___________________________________________________________________________
*! 1.0.0 KLM 18 Nov 2007
program define longgraph, rclass
	version 10
...
my code
...
twoway `cr'
return local lg `"`cr'"'

end
____________________________________________________________________________

The ´cr' is build up through a series of foreach loops, and at the end of 
the loops, `cr' could contain more than 1000 characters.


Regards Kim

Kim Lyngby Mikkelsen
Senior Researcher
National Research Centre for the Working Environment, Denmark


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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