*! version 1.0.0 06/22/94 STB-20: ssi6.1 program define simul /* progname, dots reps(#) */ version 3.1 parse "`*'", parse(" ,") local prog "`1'" mac shift if "`prog'"=="" { di in red "program name required" exit 198 } local options "Args(string) Dots Reps(integer -1)" parse "`*'" if `reps'< 1 { di in red "reps() required" exit 198 } if "`dots'"=="" { local dots "*" } else local dots "" quietly desc if _result(4)-20 < `reps' { di in red "insufficient memory (observations)" exit 901 } global S_1 capture `prog' ? `args' if _rc { if _rc==199 { di in red "program `prog' not found or" di in red _quote "`prog' ?" _quote /* */ " attempted to execute an unrecognized command." exit 199 } di in red _quote "`prog' ?" _quote " returned:" error _rc } if "$S_1"=="" { di in red _quote "`prog' ?" _quote " did not set \$S_1" exit 198 } tempfile result postfile $S_1 using `result' tempname i N scalar `N' = `reps' scalar `i' = 1 while `i'<=`N' { `dots' di in gr "." _c quietly `prog' `args' scalar `i'=`i'+1 } postclos `dots' di _n qui use `result', clear global S_FN end