Code:
local c=0
forval j=1(1)100{
/* this below statement is true for 10(10)100 */
if mod(`j',10)==0 local `++c'
}
di "The count is `c'"
Code:
The count is 100
Having an if block avoids this problem. Please let me know if there any any other workarounds, or if this is an issue I should contact Stata about.
0 Response to Unexpected behavior with in-line if statements
Post a Comment