Statalist The Stata Listserver


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

RE: st: quotation mark format change causes invalid syntax error


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: quotation mark format change causes invalid syntax error
Date   Mon, 10 Jul 2006 20:16:57 +0100

Friedrich's advice is excellent. A do file writer really 
shouldn't care about fonts, as a do file is not in any 
sense defined or characterised by what fonts it happens
to be represented in. He guesses that you are using a
word processor to edit do files, contrary to the best 
advice on dealing with do files. Of course, he is a 
contributor to that FAQ and I am its coordinator, but 
that doesn't invalidate what we say. 

Otherwise, my eye is drawn to the "don't know". It could be that 
the single quotation mark is problematic. In the first
instance, try replacing it with a space, and see if 
the problem goes away. 

In a good text editor, you should be able to find 
out which ASCII character is represented by your 
single quote character. 

Nick 
[email protected] 

Friedrich Huebler
 
> Which editor do you use? Are you typing your do-file in Word. Have
> you read the text editor FAQ?
> 
> http://fmwww.bc.edu/repec/bocode/t/textEditors.html
 
Seligman, Hilary

> > I have come across a very basic problem I am unable to solve.  I
> > have a
> > long do-file labeling all my variables.  In the middle of the file,
> > the
> > way the quotation mark looks on the screen changes for some reason
> > (it
> > looks like the quotation marks are a different font, although the
> > font
> > of the letters are actually the same).  This happens in the middle
> > of a
> > line.  Here is the line where the change begins:
> > 
> > label define continuous 1 "value given" 2 "don't know" 3 "refuse"
> > 
> > Note (if you can tell on your screen) that the quotation marks
> > around
> > "refuse" look different from those around "don't know" and "value
> > given."  
> > 
> > At this line, the do-file ends with an uninformative message:
> > 
> > invalid syntax
> > r(198);
> > 
> > 
> > No lines of code past this line of code work, and all of them have
> > the
> > quotation marks as in "refuse."  I have tried changing the font for
> > the
> > entire do-file, re-typing the quotation marks, cutting and pasting
> > from
> > the end of the do-file to the beginning, but I can not get back the
> > quotation marks that are being correctly interpreted by Stata.  If
> > I go
> > back and retype the quotation marks in the early part of the
> > do-file,
> > the quotation marks change to those like in "refuse," and that line
> > of code stops working as well.

*
*   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