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

st: Stata 9, profile.do and autolog


From   Ian Watson <[email protected]>
To   statalist <[email protected]>
Subject   st: Stata 9, profile.do and autolog
Date   Thu, 5 May 2005 18:10:42 +1000

I have encountered something strange with Stata 9 using Windows 2000.
My profile.do file has always loaded a small utility -autolog-
(available from ssc, but code also shown at end of this email). While
all the other commands in my profile.do from Stata 8 work perfectly OK
with Stata 9

eg.:
set memory 400m
set varlabelpos 12
etc

the line:
autolog using basic

causes Stata 9 to go into limbo. No Stata windows appear, and the
Windows Task Manager does not show Stata running as an application.
However, the processes tab (under task manager) does show Stata loaded
into the PC's memory.

If I restart Stata 9 without the offending line in the profile.do,
everything is fine. Moreover, I can issue the command

autolog using basic

from within Stata 9 and everything works fine, just like Stata 8.

I don't know how many other Stata 9 users are using -autolog- in their
profile.do files, but I would be interested to hear if Stata 9 is
behaving in the same way for them.

-- 
Kind regards, 
Ian

-------------------------------
Ian Watson
Senior Researcher
acirrt, University of Sydney
NSW, 2006, Australia

phone: 02 9351 5622
email:[email protected]
www.acirrt.com
-------------------------------

CODE FOR AUTOLOG

program define autolog

*! 1.0 Ian Watson 18 Dec 2002

macro drop DB* 
capture program drop autolog

  version 7.0
  syntax using/ [,sm path(string)]

  if "`sm'" ~=""{        
    local ext=""
    }
    else{
    local ext=".log"
    }
  if "`path'"~=""{
    local mydir="`path'\"
    }
    else{
    local mydir=""
    }

global DB_fname=""
global DB_filename "Enter log file name:"
window control static DB_filename 10 10 100 10
window control edit 10 20 175 8 DB_fname
window control button "OK" 10 40 50 10 DB_ok default
window control button "Cancel" 70 40 50 10 DB_can escape
global DB_ok "exit 3001"
global DB_can "exit 3000"

* change the 400 400 co-ordinates to centre the dialog box on your own screen

capture noisily window dialog "Log file details"  400 400 200 70
if _rc==3001 {
  global DB_fname="$DB_fname"+"`ext'"
  }
  else
if _rc==3000 {
    global DB_fname="`using'"+"`ext'"
  }  
global lfile="`mydir'"+"$DB_fname"

log using $lfile, append

end




*
*   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