Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: doedit foo.do


From   David Airey <[email protected]>
To   [email protected]
Subject   Re: st: doedit foo.do
Date   Fri, 27 Mar 2009 07:48:46 -0500

.

Oh right, I had a conversation with Stata about this when they were fixing a doeditor problem.

On the mac typing

doedit

brings up a temporary file that can be saved.

I have muscle memory (I feel) from a prior version of Stata that would create the file after typing doedit foo.do.

-Dave

On Mar 27, 2009, at 3:57 AM, Eric A. Booth wrote:

Uli:
For your Mac 64/MP version, just type -doedit- and you will get a do- file editor window that is 'untitled'. You'll have to click the 'save' button to name it.

There are some alternatives that can be more useful:
______
1.
You could create a read-only 'template' do-file in your pwd. You can then call this template.do file up in the Stata do-file editor by typing -doedit template- . Alternatively, you could create an .ado file that calls up that template do-file whenever you type - template- (or whatever you want to call it). The reason template.do should be read-only is so you'll never overwrite it (in Mac: Click the template.do file in Finder, Press Command+i , check "Locked" ). The advantage of storing a read-only template is that you can preload sections and commands that you use frequently (such as setting the memory, matsize, or macros for certain sessions)

Example:

program define template
   di "Data Management Do-File Template `1'"
   cd "/applications/stata/data/"
   doedit template.do
end

______
2.
A final alternative is to use fedit (found using -findit fedit-) so that you can call up your template.do in a text editor of your choice:

*First, modify the fedit.ado file to recognize your text editor, for example for the alphaX text editor on Mac your fedit.ado file could read:

Example:

program define fedit
	version 8.0
	gettoken file options : 0, parse(",")
       discard
	qui findfile "`file'" `options'
	doedit "`r(fn)'"
       shell open -a alphax.app "`r(fn)'"
end

*Next, call up your template.do (avoid using the path() option by placing template.do in your 'adopath') with the command:

fedit template.do, path(/Applications/Stata/)


Eric

__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754
Fax: +979.845.0249
http://ppri.tamu.edu


On Mar 27, 2009, at 3:08 AM, Ulrich Kohler wrote:

Am Donnerstag, den 26.03.2009, 21:18 -0500 schrieb David Airey:
.

If I type

doedit foo.do

and foo.do doesn't exist, what is the behavior of Stata on Windows or
Linux?

On the mac, Stata64/MP does nothing. I would have thought that is
should either give an error message saying the file could not be
found, or create foo.do.

On Linux, the Do-File editor starts with a buffer called foo.do, but the
file foo.do is not actually created on the hard disk. The file is
created as soon as you hit the the save button in the tool bar.

Uli

--
[email protected]
030 25491-361

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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