Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: wrapper for use


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: wrapper for use
Date   Wed, 22 Aug 2007 16:28:18 +0100

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 
n.j.cox@durham.ac.uk 

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/



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