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: tempvar in debugging


From   Wincent <[email protected]>
To   [email protected]
Subject   st: tempvar in debugging
Date   Fri, 7 Jan 2011 12:07:32 +0800

Dear all, here is the situation I ran into:

***  first case
capture program drop test
program define test
tempvar x
matrix `x'=(1,2\3,4)
pause examine matrix `x'
end

pause on
test
pause:  examine matrix __000000
-> . matrix dir
     __000000[2,2]
-> . matrix list `x'
matrix name required
r(100);
-> . matrix list __000000
__000000[2,2]
    c1  c2
r1   1   2
r2   3   4
-> . end
execution resumes...

** second case
tempvar x
matrix `x'=(1,2\3,4)
matrix list `x'

In the first case, I can't use macro name to inspect the matrix, but
the second case I can.
I wonder why it throws an error in the first case, and is there any
way to inspect the matrix instead of using the actual tempvar
__000000?

Thank you very much.

-- 
Wincent Ronggui HUANG (Ph.D.)
City University of Hong Kong
http://asrr.r-forge.r-project.org/rghuang.html
*
*   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