Hi Statalist,
I am having difficulty fixing this particular (probably syntactic?) error and would appreciate another pair of eyes looking at it.
I want to define a program inside a forvalues loop. I've written a simpler version of what I want here:
When I run this (STATA/MP 15.1 on windows 10), I receive the following error message:
Oddly, the `i' that should display at the beginning of the loop never displays itself, unless I remove the end command like this:
In this latter case, `i' displays for the first loop before I get the error message you would expect, telling me I never finished defining my program:
Thank you for the help!
Julian
I am having difficulty fixing this particular (probably syntactic?) error and would appreciate another pair of eyes looking at it.
I want to define a program inside a forvalues loop. I've written a simpler version of what I want here:
Code:
forvalues i = 1 / 12 { di "`i'" cap prog drop aaa prog def aaa di "hello `i'" end }
Code:
--Break-- r(1); end of do-file --Break-- r(1);
Code:
forvalues i = 1 / 12 { di "`i'" cap prog drop aaa prog def aaa di "hello `i'" * end }
Code:
1 1. unexpected end of file r(612); end of do-file r(612);
Julian
Comment