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   "Ladewig, Jeffrey" <>
To   <>
Subject   RE: st: quotation mark format change causes invalid syntax error
Date   Mon, 10 Jul 2006 15:22:48 -0400

I have had similar problems whenever I use MS Word (in Windows XP) to construct do-files.  My solution has been (though, now I'll be looking into these text-editors) is quite simple and pragmatic.  I type a quote sign in STATA, highlight and copy it, and then goto my Word document.  I paste the copied STATA quote sign in the REPLACE function (with the faulty quote sign copied into the FIND function) and then I REPLACE ALL.  This has worked for me, I hope it does for you too. 

Jeffrey W Ladewig
Assistant Professor
University of Connecticut
Department of Political Science
341 Mansfield Road, U-24
Storrs, Connecticut 06269-1024

-----Original Message-----
[]On Behalf Of Nick Cox
Sent: Monday, July 10, 2006 3:17 PM
Subject: RE: st: quotation mark format change causes invalid syntax

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. 


Friedrich Huebler
> Which editor do you use? Are you typing your do-file in Word. Have
> you read the text editor FAQ?
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:

*   For searches and help try:

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