DO-FILE EDITOR ENHANCEMENTS IN ACTION!
AUTOMATIC BACKUPS
While working in the Do-file Editor, disaster strikes and a brownout occurs. We temporarily lose power, and all our unsaved edits to our do-file are seemingly lost. However, Stata’s Do-file Editor had been saving our edits periodically to a backup file. When we attempt to open our do-file again, the Do-file Editor notices that there is a backup file and presents us with the option to recover the backup.
© Copyright 1996–2024 StataCorp LLC. All rights reserved.
If we had clicked the Open original button, the original file would have been opened in the Do-file Editor and the backup file would have been deleted. If we had clicked the Cancel button, no file would have been opened and the backup file would remain on disk. We would then be able to recover the backup file later.
USER-DEFINED KEYWORDS
Our do-file stpm2.do reproduces the examples in the postestimation help file for the community-contributed command stpm2, which fits flexible parametric survival models. These examples explore the effect of hormonal therapy on recurrence time using the brcancer.dta breast cancer dataset. With our do-file loaded into Stata’s Do-file Editor, Stata commands such as webuse, stset, and predict are syntax highlighted, but the community-contributed command stpm2 is not. We’ll fix that by creating a text file containing the keyword stpm2 and saving the file as stata-userkeywords.txt in our home directory. After restarting Stata and opening our do-file in the Do-file Editor again, we now see that the stpm2 command is syntax highlighted as a user-defined keyword.