--DETAB - by Les Kneeling-- ------------------------------------------------------------------------------- TAB22 was written in response to the ST User 22 line challenge. Since one of the requirements for files to reproduce properly in the magazine is that they have no tabs in them, it seemed reasonable to produce a program that removes them. DETAB is a slightly less cryptic version (which doesn't fit into 22 lines). Of course it would not be sufficient to simply replace each occurrence of a tab character (0x09) with say four spaces. This would result in a ragged listing. What is actually needed is to replace the character with the required number of spaces to move the cursor to the next tab column. The program does this by working out how far the character is from the last tab column using current_column%tabsize. It then outputs the spaces needed to reach the next tab column, tabsize - current_column%tabsize. The listing as it stands has a fixed tab size of 4, which strangely enough is what I use, although it would be simple to modify it - I would suggest that you restore it to a more normal state by making it one statement per line first. The program is called from the desktop by double clicking on the icon and supplying INPUT.EXT OUTPUT.EXT when requested. There is sufficient error trapping in the program for most cases, but you must ensure that the input and output files have different names.