! nospace.tes - replace front of line spaces with tabs may be used with modify.tec or by itself nospace.tec assumes that a file is open by EBfile$, that the buffer pointer is at the start of the file. As spaces are converted the converted lines will be typed out. When it is finished the last buffer will have been written however the file will not have been closed. The general algorithem is to find a followed by 8 spaces and replace it with a single tab character then replace any immediately following 8 spaces with a tab and so-on However you will note that a test is made for excess spaces at the beginning of the buffer too. ! [C [V ! push working registers ! 0UC ! clear count of lines changed ! < ! cross buffer loop ! :@N~^X~; ! Next search for anything, exit eof ! J ! go to front of buffer ! 0UV ! clear a verify flag ! < ! inside buffer loop ! < ! front of line loop ! ::@FS% % %; ! anchored search & replace 8 spaces! ! with one tab, exit if not found ! %V$ ! if found incriment the verify flag! > ! end front of line loop ! QV"N ! if line changed ! V ! View the line ! 0UV ! clear verify flag ! %C$ ! incriment lines changed, throw out! ! result ! ' ! end if line changed ! :@FS% % %; ! find ! ! replace with ! %V$ ! incriment the View flag ! > ! end inside buffer loop ! ZJ ! end of buffer (force N^X$ to flow into! ! next buffer ! > @^A% % QC:= @^A% line(s) edited % ]V ]C ! restore registers !