80-Bus News


Spring 1985, Volume 4, Issue 1

Page 30 of 31

As far as I am concerned, a much more satisfactory approach is to use a small BASIC program which examines the text file character by character and decides whether or not to print and save the character in a separate, new file, displaying its progress on the screen. It is slower than using PIP but the new text scrolls up at a reasonable rate, so this is not a major drawback.

The program asks for the names of the source and destination files and then reads the data from the source file, character by character. The file names must be in upper case letters and if either of them does not reside on the logged-in disk, the disk name must be quoted – e.g. B:WORKING.DOC. If a character is found whose ASCII value is greater than 127, it is converted back to a value less than 127. The program grinds on until it reaches an End-of-File marker, prints out a message and then asks if either the source or destination files are to be deleted.

A trial run will show that certain print control characters are not converted properly —- such as “B, “D, “Q, or “E. This is because their ASCII equivalents are less than 127 (control characters have ASCII codes between 0 and 31). This means that there will be normal video graphics symbols corresponding to these codes in the destination file and on the screen. The overall effect isn’t too serious, however, except where a lot of fancy printing is invoived in the source file.

10 PRINT’ WordStar tidy--up program”

20 PRINT: PRINT"File names must be in UPPER CASE”: PRINT

30 INPUT"Source [dsk:] filename.ext";F1$

40 INPUT’Destination [dsk:] filename.ext"; F2c

50 OPEN *"I",1,F1$

60 OPEN “0",2,F2$

70 Z$=INPUT$(1,#1)

80 IF ASC(Z$}>127 THEN 2$=CHR$(ASC(Z$)-128)

90 PRINT 2$;

100 PRINT #2, Z$;

110 IF EOF({1} THEN 120 ELSE 70


130 PRINT: PRINT"Finished” : PRINT

140 PRINT"Delete Source File “;F1$: INPUT Rc

150 IF R$="Y” THEN KILL Fig

160 PRINT’Delete Destination File “;F2$: INPUT RG

170 IF R$="Y” THEN KILL Peg

180 END

The interpreted BASIC program implies that MBASIC.COM must be on one of the drives in the system, and the conversion process will be rather slower than would be the case if a compiled BASIC program was used. With a largish file, the difference in execution time of the .COM version can be less than half that of the .BAS, and one has the

added advantage that MBASIC is no longer required. To give some idea of the time taken, this article took 54 seconds to ‘tidy’ using interpreted BASIC and 26 seconds using the compiled version. To produce the compiled version, one needs access to BASCOM.COM, L80.COM and OBSLIB.REL; the resultant .COM file does not need BRUN.COM – which would be the case if BASLIB.REL were used instead of OBSLIB.


Price P&P .CP/M-80: AllDisc (Read/Write most other formats) .............. £150 £1 Turbo Pascal 3.0 oo. eescsssscsssssnssessnssscesscectensesenenenees £55 £1 Turbo Toolkit (B-tree ISAM file management) ........ £49 £1 ReadUCSD £25 £1


UCSD Development System (IV.13}: including

filer, editor, developmenttools and 1 compiler

(Pascal, FORTRAN, BASIC) This premiere system

offers dynamic segmentation and separate

compilation to libraries ...........0..... . w. £195 £2 (Nascom requires AllBoot EPROM ..........csccceeenee £ 25) Extra Compiler £95 £1

Advanced Development Tool Kit (Native Code Generator, Z80 Assembler, Linker & Analysis

Tools) £95 £1 AllDisc enhancement (p-system only) ..........:ccc0 £75 £1 Pluto Graphics LIDrary 0.00... esseeseeneereccereesenatereee £75 £1 ReadCPM £25 £1

Complete systems (hardware and software) supplied to order.

VAT at 15% to be added to all prices. Please send cash with order and full details of the hardware you are running onto:

Mike York Microcomputer Services _ ________ ____, LONDON ____ ___. Tel: __-___ ____.

This is an OCR’d version of the scanned page and likely contains recognition errors.

Page 30 of 31