Hi all,
Ok ...managed to get this to run from a menu item.
Firstly, added the following lines to the profile.do file
window menu append submenu "stUser" "&Name"
window menu append item "Name" "&Fname" "myprog1"
This will create a submenu fname under name in the user menu.
Secondly,
a. created a simple ado file in the ado\personal folder to run a do file
The ado file looks like this:
capture drop program myprog1
program define myprog1
run "C:\Stata8\a.do"
end
b. created a do file in the stata8 folder
The do file looks like this:
local b=c(filename)
_getfilename `"`b'"'
local c=r(filename)
window manage maintitle `c'
This works
But, I have a feeling this is a bit longwinded..
Is there a better way to do it?
Thank You
Rajesh
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rajesh Tharyan
Sent: 22 August 2007 14:46
To: [email protected]
Subject: st: wrapper for use
Hi,
I was trying to get only the filename to display on the title bar. The best
I could come up with is
local b=c(filename)
_getfilename `"`b'"'
local c=r(filename)
window manage maintitle `c'
How can I execute this code automatically on (after?) opening a file?
As a crude option can put a menu item on the tool bar which will run this
program?
I use stata 8.2
Thank you
Rajesh
*
* 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/
*
* 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/