Statalist


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

Re: st: problem with -return macro-


From   Tirthankar Chakravarty <[email protected]>
To   [email protected]
Subject   Re: st: problem with -return macro-
Date   Mon, 25 Jan 2010 22:36:28 +0530

Try this:
************* test ***************
cap program drop test
program define test, rclass
       version 11
       local rlist
       forv i=1/50 {
               local text "text`i'"
               local rlist `rlist' `text'
       }
       di "`rlist'"
       return local test `"`rlist'"'
end

test
di "`r(test)'"
**********************************

On Mon, Jan 25, 2010 at 10:22 PM, Jeph Herrin <[email protected]> wrote:
>
> I thought I understood this, but maybe I'm just making
> an obvious typo. When I run the following
>
> ************* test ***************
> program define test, rclass
>        version 11
>        local rlist
>        forv i=1/40 {
>                local text "text`i'"
>                local rlist `rlist' `text'
>        }
>        di "`rlist'"
>        return local test `"`rlist'"'
> end
>
> test
> di r(test)
> **********************************
>
> Why is -rlist- truncated to 244 chars in the return list? I have
> tried this a number of different ways (I guess I have never tried
> to return a long string before?); I thought as long as I used
> macro copy rather than evaluate, macros would not get truncated.
> I have tried many variations on the -return- assignment, but this
> is the one explicitly recommended on [P] page 340.
>
> thanks,
> Jeph
>
>
>
>
>
>
> *
> *   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/
>



-- 
To every ω-consistent recursive class κ of formulae there correspond
recursive class signs r, such that neither v Gen r nor Neg(v Gen r)
belongs to Flg(κ) (where v is the free variable of r).

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