Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: testing equivalence of long variable lists


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: testing equivalence of long variable lists
Date   Thu, 25 Mar 2010 20:11:14 -0000

See help on -macrolists-. The answer is 

local same : list tmp1 == tmp2 

or 

local same : list tmp1 === tmp2 

Nick 
n.j.cox@durham.ac.uk 

Jeremy Freese

I have some old code that uses this statement:

if "`tmp1'"=="`tmp2'" {

where tmp1 and tmp2 contain variable lists.  My understanding is that
if the variable list is longer than 244 characters, this will evaluate
to true if there is some difference between tmp1 and tmp2 after the
244th character.  Is this correct?  How does one test the equality of
long macros?


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index