The windowsy stuff I leave to others but your code
local b=c(filename)
_getfilename `"`b'"'
local c=r(filename)
window manage maintitle `c'
can probably be collapsed to
_getfilename `"`c(filename)'"'
window manage maintitle `r(filename)'
modulo things that bite people who put spaces
in filenames.
Nick
[email protected]
Rajesh Tharyan
> 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?
*
* 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/