*! version 1.0.0 , apr 98, Guy van Melle STB-45 gr30 *! *! copies one row of a matrix into a global macro, optionally reversed *! *! syntax: mat2mac matname rownum macname format [, Reverse] *! *! eg mat2mac A 2 uu %6.2f , r *! *--------------- prog def mat2mac *--------------- * version 5.0 loc A `1' loc r `2' loc mac `3' loc f `4' mac shift 4 loc options "Reverse" parse "`*'" loc c= colsof(`A') glo `mac' if "`reverse'"=="" { loc k 0 while `k'<`c' { loc k=`k'+1 loc a: di `f' `A'[`r',`k'] glo `mac' "$`mac' `a'" } } else { loc k=`c'+1 while `k'> 1 { loc k=`k'-1 loc a: di `f' `A'[`r',`k'] glo `mac' "$`mac' `a'" } } mac di `mac' end *