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

st: Re: rolling your own

From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: rolling your own
Date   Sat, 10 Aug 2002 07:36:42 -0500

--On Saturday, August 10, 2002 2:33 -0400 Jens wrote:

A user wishes 3 decimals in certain output instead of 1, just change the
format of that display line from %8.1f to %11.3f and you have a new
output. In this situation I would:
1. add a line at the top of the ado: *! Modified in line xx for display of
more decimals
2, change the name of the command, e.g. _cut to _cutjl and save the ado
under a new name to make sure I had not by mistake introduced an error in
a core or addon program.
This is good advice, but must be qualified. If I did this literally, I would end up with cutjl.ado WITHIN THE STATA FOLDER. A very bad idea to put anything of yours in the Stata folder; it should go in /ado, /ado/personal, your current directory, whereever you wish, but not within the Stata folder. Otherwise, when you go to update your Stata to the new version someday, you risk losing all of the personal stuff if you do not remember about it.

Users who are developing their own stuff (even if by simple modifications of official routines) should familiarize themselves with 'adopath' and understand where Stata will locate the routines. Stata's capabilities to look in several places for a routine is very useful, but sometimes can bite you if you're not aware of the order that 'adopath' implies. Jens' advice to ALWAYS save under a new name (I tend to use 'foo2' for the modified foo.ado) and to use 'which...' to see where the routine lives is apropos here.

* For searches and help try:

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