#delimit ; program define tutor; * * Attempts to set up the tutorial given as the argument. *; version 3.0; cap run tutor.do; cap run c:\ado\tutor.do; cap run c:\stata\tutor.do; cap run c:\stata\ado\tutor.do; cap run .\ado\tutor.do; cap macro drop title1 title2 title3 title4 title5 title6 title7 title8 title9 title10; macro define zztn = "`1'"; while "$zztn"=="" {; inprompt "What is the name of the tutorial you want to run"; macro define zztn = "$junk"; }; cap drop _all; cap prog drop $zztn; macro define class = "Econ 351A"; macro define univ = "Queen's University"; macro define logon = 0; macro define zzsteps = 0; macro define zzstep = 1; cap run $zztn; if $zzsteps==0 {; local zz = "\stata\ado\"+"$zztn"; cap run `zz'; if $zzsteps==0 {; local zz = "\ado\"+"$zztn"; cap run `zz'; if $zzsteps==0 {; local zz = "\stustata\ado\"+"$zztn"; cap run `zz'; if $zzsteps==0 {; local zz = "\stustata\"+"$zztn"; cap run `zz'; if $zzsteps==0 {; di in r "I can't find the steps in the $zztn tutorial. They are contained" _n "in a file called $zztn.do. If you haven't done so already" _n "get week1.do and re-run this tutorial." _n(2) "Exiting tutorial program ..."; exit; };};};};}; set more 1; di in y " Welcome to ...... " _n(2) _col(10) in y " ------------------------------------------------------ " _n(2) _col(10) in b " --------- . . --------- .-------. .-----. " _n _col(10) " | | | | | | | | " _n _col(10) " | | | | | | |-----\ " _n _col(10) " | |_______| | |_______| | \ " _n _col(10) " " _n _col(10) in y " ------------------------------------------------------ " _n _col(10) _n(2) _col(10) in y " A set of programs and interactive tutorials " _n _col(10) " in econometrics written and developed by " _n _col(10) in w " Chris Ferrall " _n _col(10) " Department of Economics " _n _col(10) " Queen's University " _n _col(10) " ferrall@qed.econ.queensu.ca " _n(2); macro define id = 0; macro define sname = " "; inprompt "Enter your $class number"; if "$junk"!="" {;macro define id = "$junk";}; inprompt "Enter your name"; macro define sname = "$junk"; macro define zzln = "${zztn}_$id.log"; di in b "Press any key to continue"; set more 8; more; set more 0; intro; inprompt "Do you want to see a list of tutor commands (y/n)"; if "$junk"=="y" | "$junk"=="Y" {; thelp; refresh; }; inprompt "Do you want to record screen output in a file (y/n)?"; if "$junk"=="y" | "$junk"=="Y" {; macro define logon = 1; cap log using $zzln, replace; di in y "Your tutorial session will be recorded in a file called " in w "$zzln" _n in y "in your working directory. When you exit Stata you can look at the file,"_n "edit it, print it out, or copy it to a floppy diskette."; }; else {; macro define logon = 0; }; prompt "when ready to go to step 1"; donext; end;