Foley, Mark
> I'm looking to switch my stats & econometrics classes
> from SAS to Stata and am wondering
> if Stata can color-code do-files as you write them (for
> example, SAS commands appear in one color, user-defined
> text in another, stuff that SAS won't understand in red,
> etc.). This is a nice feature in SAS, especially for beginners.
>
I don't think this is available in Stata. It was suggested at the
London
users' meeting last week. Meanwhile the FAQ at
http://repec.org/docs/textEditors.html#syntax
documents external text editors which will do something like this.
However, I can see that it may not be practical to expect
your students all to use one of these editors.
Here is an extract
Syntax highlighting
Details differ, but the main idea of syntax highlighting
is that different elements of the syntax of a language
are coloured in your text window(s) in different ways.
For this to work, someone has to write a specification
of the syntax, such as Stata syntax, in a form intelligible
to the editor. Even an imperfect specification can be
a great help in aiding your editing: for example, apparent
mistakes may be coded distinctly, which helps you to spot
unmatched quotation marks, braces, square brackets and
parentheses. If an editor offers syntax highlighting
for one language, then it probably offers highlighting
for many more, unless it is the editor part of some
development environment built around the interpreter
or compiler for a specific programming language.
This can be useful also to people editing web documents:
some prefer to use a general text editor for editing
(say) HTML documents, rather than dedicated web software,
if only because they find that they do not need extra tools.
To our knowledge, some kind of syntax highlighting for
Stata do or ado files is currently available for Alpha,
Emacs, jEdit, SlickEdit, vim, EditPlus, EmEditor, TextPad,
and UltraEdit, as is explained in appropriate sections below [i.e. in
the FAQ cited].
Even if no Stata syntax highlighting is available in other editors,
using (say) C syntax highlighting if available is interesting
and possibly even useful.
Nick
[email protected]
*
* 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/