I have noticed that, seemingly without warning, Stata started put an extra space after the first quotes.
For example, if I wrote
Stata read it as if it was written
This is how I solved it. I went to that line of the code, put the cursor right before the "c:", pressed delete and, great surprise, there the cursor did not move.
However, I rerun the same code immediately afterwards, and now Stata read it correctly, without the extra space before the "c".
Also, there was a similar further anomaly.
Probably, it added an extra space somewhere invisible at the end of an ado file of mine, because this is what has happened to me.
I was working on an ado file that used to work perfectly.
Then, all of a sudden stopped working only on my machine with Stata 14, while the very same ado file worked with Stata 16, on a different machine.
In the machine with Stata 14, Stata was giving me this error message:
But I could not understand, because I checked all parentheses "}", I was not using "#delimit ;" and I was not using "infile" (these are the three potential mistakes suggested by Stata, after I cliked on r(612)).
I tried to debug this ado file with "set trace on", but of course, it could not work because the ado file was not even loading.
Then I found this old post from the old statalist, which suggests a way to debug it.
Bill's Point 4. in that linked post suggested running the ado as if it was a do file.
And, after I run the ado as if it was a do file, I see that Stata stopped right before "end".
But I could not see anything strange. So, I did this: the line before "end" was blank, I deleted it, I reinserted the hard return and now the ado file worked.
Unfortunately, this was so strange and "invisible" that I cannot think of a way of replicating it to show it here.
I do not think there was something wrong with the computer.
It is like if in some places of the ado file, the place where the blinking cursor stood actually included one invisible extra blank space that caused the issues I described above.
And please remember: these issues occured only in the machine with Stata 14 and never before then in other do or ado files, while the same ado was working perfectly with Stata 16.
Anything like that happened to anybody?
If yes, do you know why?
For example, if I wrote
Code:
cd "c:\mypath\myfolder"
Code:
cd " c:\mypath\myfolder"
However, I rerun the same code immediately afterwards, and now Stata read it correctly, without the extra space before the "c".
Also, there was a similar further anomaly.
Probably, it added an extra space somewhere invisible at the end of an ado file of mine, because this is what has happened to me.
I was working on an ado file that used to work perfectly.
Then, all of a sudden stopped working only on my machine with Stata 14, while the very same ado file worked with Stata 16, on a different machine.
In the machine with Stata 14, Stata was giving me this error message:
Code:
unexpected end of file (error occurred while loading myprogram.ado) r(612)
I tried to debug this ado file with "set trace on", but of course, it could not work because the ado file was not even loading.
Then I found this old post from the old statalist, which suggests a way to debug it.
Bill's Point 4. in that linked post suggested running the ado as if it was a do file.
Code:
program drop _all do <insert full path and filename here>
But I could not see anything strange. So, I did this: the line before "end" was blank, I deleted it, I reinserted the hard return and now the ado file worked.
Unfortunately, this was so strange and "invisible" that I cannot think of a way of replicating it to show it here.
I do not think there was something wrong with the computer.
It is like if in some places of the ado file, the place where the blinking cursor stood actually included one invisible extra blank space that caused the issues I described above.
And please remember: these issues occured only in the machine with Stata 14 and never before then in other do or ado files, while the same ado was working perfectly with Stata 16.
Anything like that happened to anybody?
If yes, do you know why?
Comment