*! version 1.0.0 27April1999 (STB-56: sbe35) program define calcmenu quietly version local ver=_result(1) *version 5.0 if "$S_OS"!="MacOS" & "$S_OS"!="Windows" { di in red /* */ "Calcmenu is for use with Stata for Windows and Stata for Macintosh only" exit 198 } if "`1'"=="off" & "$C_MENU"~="on" { di "Calcmenu menus are not on. Type -calcmenu on- to turn them on." exit } if "`1'"=="off" & "`ver'" == "6" & "$S_OS" == "Windows" { quietly query born if "$S_1" < "14271" { di in blue /* */ "Your copy of Stata cannot use " /* */ in white "calcmenu off" in blue " to change the menus back to Stata's" di in blue /* */ "default menus. To reset the menus, please exit Stata and restart it." di in blue /* */ "There is an update to Stata available which will allow you to use " /* */ in white "calcmenu off" di in blue /* */ "to restore Stata's menus. Please type " in white "update all" /* */ in blue " to update your Stata now." exit } } if "`ver'" == "6" & "$S_OS" == "Windows" & "`1'" != "ON" { quietly query born if "$S_1" < "14271" { di in blue /* */ "Before using Calcmenu, you should update your copy of Stata to the" di in blue /* */ "latest executable. If you do not update your executable, you can" di in blue /* */ "force Calcmenu to start by typing " in white "calcmenu ON" /* */ in blue " (note the capitalization)," di in blue /* */ "but the Help menu and" in white " calcmenu off" in blue " will not work. " /* */ in blue "You will have to exit " di in blue /* */ "Stata to switch from Calcmenu back to the Stata menus." di in blue /* */ "Updating your executable will fix this. " di in blue /* */ "Type " in white "update all" /* */ in blue " to download the latest executable." exit } } if "`1'"=="off" & "$C_MENU"=="on" { window menu clear if "`ver'"=="5" { quietly adopath -"$qpath" } global qpath global C_MENU "off" di "Calcmenu menus off. The menubar has been changed." exit } if "$C_MENU"=="on" { di "Calcmenu menus already on. Type -calcmenu off- to turn them off." exit } global S_QUEST "off" global C_MENU "on" if "`ver'"=="5" { getstpat quietly adopath +"$qpath" } else if "`ver'"=="6" { global qpath "" } window menu clear window menu append popout "sysmenu" "&Calculator" window menu append popout "sysmenu" "Ep&icalc" window menu append string Calculator "1-sample &normal test" "zt1dlg" window menu append string Calculator "2-sample n&ormal test" "zt2dlg" window menu append string Calculator "1-sample t &test" "tt1dlg" window menu append string Calculator "2-sample t t&est" "tt2dlg" window menu append string Calculator "&1-sample test of proportion" "tp1dlg" window menu append string Calculator "&2-sample test of proportions" "tp2dlg" window menu append string Calculator "1-sample test of &variance" "sdt1dlg" window menu append string Calculator "2-sample test of v&ariance" "sdtdlg" window menu append string Calculator "&Confidence interval for mean" "ccidlg" window menu append string Calculator "&Binomial confidence interval" "bcidlg" window menu append string Calculator "&Poisson confidence interval" "poidlg" window menu append popout Calculator "&Statistical tables" window menu append string "Statistical tables" "&Normal" "zdlg" window menu append string "Statistical tables" "Student's &t" "tdlg" window menu append string "Statistical tables" "&F" "fdlg" window menu append string "Statistical tables" "&Chi-squared" "xdlg" window menu append string "Statistical tables" "&Binomial" "bdlg" window menu append string "Statistical tables" "&Poisson" "pdlg" window menu append popout Calculator "&Inverse statistical tables" window menu append string "Inverse statistical tables" "&Normal" "zidlg" window menu append string "Inverse statistical tables" "Student's &t" "tidlg" window menu append string "Inverse statistical tables" "&F" "fidlg" window menu append string "Inverse statistical tables" "&Chi-squared" "xidlg" window menu append string Calculator "St&andard calculator" "cstddlg" window menu append string Calculator "&RPN calculator" "crpndlg" window menu append string Epicalc "&Incidence rate" "calciri" window menu append string Epicalc "Cohort &study" "calccsi" window menu append string Epicalc "Case-&control" "calccci" window menu append string Epicalc "&Matched case-control" "calcmcci" window menu set sysmenu di "Calcmenu menus on. The menubar has been changed." di "Switch calcmenu off before attempting to load quest menus." di in blue "If quest has not been installed, you will not be able to " di in blue "use the Calculator menu." end program define getstpat version 5.0 local x = substr("$S_ADO", 1, index("$S_ADO",";")-1) if substr("`x'", -3,.) != "ado" { di in red "I do not understand how Stata is installed." di in red "The first element of S_ADO is not as I expect" di in red "it to be." } if "$S_OS"=="Windows" { global qpath "`x'\\quest" } else { global qpath "`x':quest" } end