Agriculture Reference
In-Depth Information
(Macintosh, Windows, or Unix). On the Macintosh, in order from the
left side are icons used for opening a do-file, saving your do-file, printing
the do-file, searching the open do-file, and showing paragraph marks.
On the right top of the Do-File Editor are the Run and Do icons. The
Run icon executes the program without echoing results to the Results
window, while Do does echo the results to the Results window.
Both Windows and Unix computers' Do-File Editor will have a
different appearance, but will have the same overall functionality. On
Windows computers, because menus are integrated into the window,
much of the functionality is found under these menus. There also are
several icons across the top of the window for saving, opening, and
creating new do-files. Also available are icons for cut, copy, and paste
as well as undo and redo. There are also icons for searching the current
file and for executing the do-file (FigureĀ 7.1).
A nice new feature of the Do-File Editor is colors for different ele-
ments in a program. Different colors can be chosen for commands,
functions, comments, strings, variable types, macros, and numbers.
These features can be accessed from the Preferences item under the
Stata menu. On a Unix or Windows platform, click Edit in the
Do-File Editor and then select Preferences. This can make reading
and debugging programs a lot easier and can make your programs
more readable by others.
Line numbers also can be added to the editor from the preferences
and when a line number is selected a bookmark is added. You can use
this feature to quickly navigate through a program.
Other features available in the Preferences for the Do-File Editor
include auto-tabbing, opening new do-files as either new tabs or
new windows on a Macintosh. New windows are not available on a
Windows platform, but the same functionality of viewing two files
simultaneously is available by dragging the tab for a file into the view-
ing area.
Let's begin to use Stata's programming capabilities with a sim-
ple program that expands the usefulness of Stata. FigureĀ 7.1 shows
the Do-File Editor with the complete program. The complete pro-
gram is available as anovalsd.do, which can be loaded to see the
different colors associated with different elements of the program.
Although the program is available on disk, let's go ahead and start
a new Do-File Editor screen. This program will be called anovalsd ,
Search WWH ::




Custom Search