| ![]() |
From | Tak-wai Chau <tchau@troi.cc.rochester.edu> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: single-line vs multiple-line -if- command |
Date | Fri, 06 Apr 2007 12:53:41 -0400 |
Dear all,
I encountered a strange behavior -if- and/or macro inline incrementation operators and was wandering what's going on.
Lets consider this example:
local a=1
local b=1
if 0 local a1=`a++'
if 0 {
local b1=`b++'
}
display `a', `b'
2 1
Although both expressions are false an therefore neither a1 nor b1 will be created, `a' is incremented anyways. If we say that two versions of -if- statement are equivalent then I'd expect exactly same outcome no matter what type of commands and operations (like inline macro substitution) is used. Am I confusing something here?
I would appreciate any thoughts about the issue,
Thanks,
Zurab
*
* 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/
* * 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–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |