[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Converting TABS to equivalent SPACES ?



** Reply to message from "Brian Henderson"  on Sat, 4
Oct 2003 14:35:30 -0700

The fundamental idea in Brian's routine to replace tabs with spaces is
good, but the execution is all wrong. For example, run it against four
consecutive tabs -- it bombs. Also: doesn't set the display type (MUST
be WG), doesn't set insert, sets unnecessary variables and labels, etc.
Here are replacements: first, a (prolix) routine for Xy3+ including early
versions that wouldn't accept nested conditionals; second, a trim version
for Xy4+ (tailored for inclusion in U2).

Xy3+:
XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SX01,{<}CP{>}{>}[WG_][BF_][SI_]{<}LBA{>}[BC_]seb {tab}[XC
_]{<}IF{<}ER{>}{>}{<}GLB{>}{<}EI{>}{<}SX02,{<}CP{>}{>}{<}IF{<
}PV02{>}<{<}PV01{>}{>}{<}GLB{>}{<}EI{>}[CR_]{<}SX02,{<}CL{>}{
>}[BD_]{<}SX03,{<}CL{>}{>}{<}SX04,{<}PV02{>}-{<}PV03{>}{>}{<}
LBC{>}{<}IF{<}PV04{>}<1{>}{<}GLA{>}{<}EI{>} {<}SX04,{<}PV04{>
}-1{>}{<}GLC{>}{<}LBB{>}[BC_]jmp {<}PV01{>}[XC_][BC_][GT_]{<}
PRDone{>}{<}EX{>}[cr|lf]
-nd
XPLeNCODE

Xy4+:
XPLeNCODE v2.0
b-gin [UNTITLED]
[BX_]es 1[Q2_]{<}SX50,{<}CP{>}{>}[WG_][BF_][SI_]{<}LBA{>}[BX_
]seb  [Q2_]{<}IF@NOT({<}ER{>}){>}{<}IF{<}CP{>}>={<}PV50{>}{>
}[CR_]{<}SX01,{<}CL{>}{>}[BD_]{<}SX02,{<}PV01{>}-{<}CL{>}{>}{
<}CUB,02{>} {<}LBB{>}{<}GLA{>}{<}EI{>}{<}EI{>}[JM_]2.ReJuMP[Q
2_]{<}PRDone{>}{<}EX{>}[cr|lf]
-nd
XPLeNCODE


-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------