[net.micro] Source for Wordstar Converting Program

werner@aecom.UUCP (Craig Werner) (04/15/85)

The following is a short simple program to convert Wordstar Document
files to Non-Document (in cases where no Control characters are
embedded, this means ASCII) files.

It's in BASIC because since BASIC comes with MS-DOS, I assume everybody
has it. Also, it was there.

----------------------------- cut here -------------------------------------
1 KEY OFF
5 CLS
10 'Another attempt at WSPATCHING
15 'Craig Werner (werner@aecom.UUCP) 1935-14E Eastchester Rd. Bronx NY 10461
20 INPUT "Filename to convert"; FINAME$
21 IF RIGHT$(FINAME$,3) <> "hrd" THEN GOTO 30
23      PRINT "Cannot convert a filename with extension '.hrd' -Sorry."
25      INPUT "type 'Q' to quit, any key to retry.";Q$
27      IF (Q$="Q")OR (Q$="q") THEN GOTO 1000 ELSE GOTO 20
30 OPEN "R",1,FINAME$,1 : FIELD #1, 1 AS A$
31 OPEN "R",2,FINAME$+".hrd",1 : FIELD #2, 1 AS B$
35 REC = 1
36 PRINT "Length" ; LOF(1)
40 WHILE NOT EOF(1)
50      GET #1, REC
51 IF ASC(A$) = 26 THEN GOTO 65 'Control-Z = 26.
55      LET C$ = CHR$(ASC(A$) AND 127)
60      IF ASC(C$) <> 10 THEN PRINT C$;
61      LSET B$=C$ : PUT #2, REC
65      LET REC = REC + 1
70 WEND
80 CLOSE #1 : CLOSE #2
1000 END

------------------------------- cut here too ---------------------------------

If anyone decides to embellish this I would appreciate getting the modified
source. Otherwise, feel free to use it.


-- 
				Craig Werner
				!philabs!aecom!werner
		What do you expect?  Watermelons are out of season!