Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Stata and WinEdt as text editor


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Stata and WinEdt as text editor
Date   Tue, 30 Sep 2003 15:10:43 +0100

[email protected]
 
> I am sorry if this is slightly OT. I would like to use my 
> favourite Editor
> (WinEdt) for do-file editing. After having read
> http://fmwww.bc.edu/repec/bocode/t/textEditors.html , I 
> wrote the following
> program and stored it in an ado-file:
> 
> program winedt
>        version 8
>        * discard
>        winexec "D:\Programme\WinEdt\WinEdt.exe" `*'
> end
> 
> Now, typing
> - winedt -
> in Stata works fine, but when specifying a file name, like - winedt
> myfile.do-, winedt fails to look in the current Stata 
> working directory for
> myfile. Instead, it looks in the directory where WinEdt was 
> opend last
> time, and fails to open myfile.do. If I specify the whole 
> path to myfile,
> everything works fine, but it is more typing work each time.
> 
> I could not change this behaviour from within WinEdt. Is 
> there some way to
> modify the above program in such a way that on typing - 
> winedt myfile.do -,
> stata substitutes "current_working_dir\myfile.do", and that 
> specifying a
> file name at all is still optional?
> 

Nothing OT about this at all. 

Try 

program winedt
        version 8
        * discard
	  if "`*'" != "" local file "`c(pwd)'\`*'"
        winexec "D:\Programme\WinEdt\WinEdt.exe" `"`file'"' 
end

Evidently we need a volunteer to write a WinEdt section 
for this FAQ.... 

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/



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