<>
" Seems like a bug."
But note [U], p. 209:
" Finally,
local i++
will not increment the local macro i but instead redefines the local macro i
to contain ++."
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Jeph Herrin
Gesendet: Freitag, 8. Januar 2010 04:31
An: [email protected]
Betreff: st: increment operator
Is the behaviour of the following to be expected?
local C = 0
forv i=1/10 {
di "`C'"
local C++
}
I know the increment operator is ++C, but inadvertently used this
instead and could not track down the error for quite a while, because
it even produced integer values in places. Seems like a bug.
Especially as trailing ++ is allowed in expansion operators:
local C=0
forv i=1/10 {
di "`C++'"
}
works just fine.
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/
*
* 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/