|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: AW: increment operator
--------
Sent from my HP iPAQ
-----Original Message-----
From: Jeph Herrin <[email protected]>
Sent: Friday, January 08, 2010 1:38 PM
To: [email protected] <[email protected]>
Subject: Re: st: AW: increment operator
So, intentionally bad behaviour.
Martin Weiss wrote:
> <>
>
>
> " 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/
>
*
* 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/