/* REXX: Convert xxxDV and xxxDH space units to xxx.xxMM for NX lines*/ /* author: David McRitchie, "The REXX Macros Toolbox" Jan 17, 1992 */ /* FDM updated 1992/01/21 19:03 */ Address "ISREDIT" "MACRO (TOKEN)" numeric digits(16) If token = "" then token = 2 do forever "F first suffix p'#dv' nx" if rc /= 0 then leave call common; end do forever "F first suffix p'#dh' nx" if rc /= 0 then leave call common; end do forever "F first word p'#dv' nx" if rc /= 0 then leave call common; end do forever "F first word p'#dh' nx" if rc /= 0 then leave call common; end return common: procedure expose token; "(LN,PO2) = CURSOR" "f 'd' next nx" "F prev prefix p'#' nx" "(LN,PO1) = CURSOR" "(LINE) = LINE .ZCSR" from = substr(line,po1,po2-po1+1) if token = 0 then to =trunc(from * .105833333 + .5) else if token = 1 then to =trunc(from * 105833333 + .05,1) else to =trunc(from * .105833333 + .005,2) to=to; tox=to linex = substr(line,1,po1-1)||TOX||"mm"||substr(line,po2+3) "LINE .zcsr = (linex)" /* optional "c 1 p'=' p'=' .zcsr .zcsr all"*/ return /*********************************************************************/ /* to convert xxxDH to xxxMM multiply by .105833333 */ /* (= 25.40 mm/in divided by 240 dh/in ) */ /* (= 25.40 / 240, round to 2 decimal places or as in TOKEN */ /* 240 DH/IN on 3800-3, do not use this clist for PostScript */ /* by law US inch = 2.54 cm, or 1 yard = .9144 meters */ /*********************************************************************/