Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Invalid file specification


From   "Hendri Adriaens" <[email protected]>
To   <[email protected]>
Subject   RE: st: Invalid file specification
Date   Sat, 7 Jul 2007 16:00:07 +0200

Hi Austin, 

> In these situations, if you -set trace on- you can usually see the
> source of the problem immediately.  In this case, I suspect you have
> forgotten that -if exp {- must appear on a line by itself (see -help
> ifcmd-), i.e. you must have a delimiter between "{" and "local" below.

Ok, thank you. I couldn't think that that was the problem from an "invalid
file specification" error, so thanks for the help.

> Your postscript assumes either Stata (or you) would want to -set tr
> on- all the time, I think.  Or somehow magically reach into the guts
> of programs and tell you where you forgot a keystroke.  Neither is
> reasonable IMHO.

If stata can detect a syntax error, it does know what was not along the
rules of the syntax and where it happened. It can tell me that along with
the error message that it produces now. "Syntax error"  is not at all
informative. Of course I made an error, otherwise the code would run.

-set trace on- does work, except that it produces a lot of output. (Yes, one
can set depth.) But it does include the syntax error that actually made my
code fail. If only it would output that error and the code that triggered
it, nothing more, certainly not error message that only confuse.

But anyway, thanks for your help. If my code fails again next time, I will
-set trace on- and hope that I can spot the true error message.

Best regards,
-Hendri.


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index