*! version 1.0 17 Jun 1997 STB-40 ip20 program define memchk version 5.0 quietly describe, detail short local width = _result(3) local ws = _result(6) while "`1'"!="" { if "`2'"=="" { error 198 } confirm integer number `2' if "`1'"=="int" { local width = `width' + 2*`2' } else if "`1'"=="byte" { local width = `width' + `2' } else if "`1'"=="long" | "`1'"=="float" { local width = `width' + 4*`2' } else if "`1'"=="double" { local width = `width' + 8*`2' } else if substr("`1'",1,3)=="str" { local len = substr("`1'",4,.) confirm integer number `len' local width = `width' + `len'*`2' } else { error 198 } mac shift 2 } if `width' > `ws' { di _col(8) in red "insufficient memory" exit 900 } end