*! version 1.0.0 10/28/93 STB16: zz3 program define stb_next version 3.1 if _N==0 { di in gr "(nothing found)" exit } if _N==1 { * di _n in gr "1 match found" while (1) { stb_list 1 stb_dtl exit } /*NOTREACHED*/ } local k : di "--Top Level-- --"_N " matches found--" tempvar issue m pre post qui sort insert local ex = insert[int((1+_N)/2)] while (1) { di in gr "`k'" di in gr " Enter " in wh "1" /* */ in gr " (list by insert) " in wh "2" /* */ in gr " (list by issue) " /* */ in wh "end" in gr " or nothing (back up)" di in gr _col(10) "insert number such as " /* */ in wh "`ex'" in gr /* */ " (see detail on insert)" di in gr _col(10) "-> " _request(_answ) if "`answ'"=="2" { quietly { gen int `issue' = real(substr(stb,5,.)) sort `issue' insert drop `issue' } capture noisily stb_list 3 if _rc==1 { di in red "--Break--" } } else if "`answ'"=="1" | "`answ'"=="l" { quietly { gen byte `m'=real(substr(insert,3,1)) gen str3 `pre'=substr(insert,1,cond(`m'==.,3,2)) gen float `post'=real(substr(insert,/* */ cond(`m'==.,4,3),.)) sort `pre' `post' drop `m' `pre' `post' } capture noisily stb_list 3 if _rc==1 { di in red "--Break--" } } else if "`answ'"=="" | "`answ'"=="end" { exit } else if "`answ'"=="?" | "`answ'"=="??" { #delimit ; di in gr _n _dup(79) "-" _n "More than one insert was found matching your search criterion. You can list" _n "the inserts by typing " in wh "1" in gr " or " in wh "2" in gr ". You can enter the insert number shown on the" _n "listing to get more informaton about the insert. You back up and specify a" _n "a different search criterion (or exit the informer) by simply pressing Enter." _n _dup(79) "-" ; #delimit cr } else { stb_sel "`answ'" } di } /*NOTREACHED*/ end