Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: small problem with return macro


From   Jean-Benoit Hardouin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: small problem with return macro
Date   Sat, 10 Apr 2004 11:29:03 +0200

I have a small problem to use macros in the return command of a program.

See the following program :

program define pgmmac, rclass
local essai 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
return local mac `essai'
end

then type
. pgmmac
. return list
macros:
r(mac) : "01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50"

It's OK.

But if I want to save this macro r(mac) in an other macro I have a problem (limit to 80 characters) :

. local jb=r(mac)

. di "`jb'"
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2

. local jb r(mac)

. di "`jb'"
r(mac)

How solve this problem and to save all the characters of the macro r(mac)?

Thank you for your response

--
*****************************************************************************
Jean-Benoit Hardouin
37 rue Arrachart
41000 Blois
tél : 02 54 45 39 75
email : [email protected]
*****************************************************************************
*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index