PARMS: FLOWTXT ? = Firgures out paragraph endings
FLOWTXT P = Each line is a paragraph
FLOWTXT C = Each paragraph is separated by a blank line
EXAMPLE: FLOWTXT P \TEMP\EBOOK.TXT
Used to "reflow" text that may have imbedded control characters to make such text suitable for conversion to web
pages, EPUP, etc. (PalmDoc Smallest size - Readable on Android Using CoolReader).
Each paragraph becomes one lone line with one space between words and sentences. Suitable for PALM-DOC converters and HTML Text. Removes
line-break characters replacing with one space. Removes hanging hyphen at end of line. Very fast - can process 26,000 lines in about
10 seconds. Save Text in MSDOS Text line line break format when processing captured text (from html cut and paste) or RTF. Set to call
SPFPRO for Last Minute Editing of TXT, Rex waits for SPFPRO to exit, then pocesses text and DOCREADER to create PalmDOC (PDB) document.
Note that DOCREADER can load PDB files and save them as text allowing processimg into another DOC format.
ARG PARMS
PARMS = TRANSLATE(PARMS) ;
FILENAME = WORD(PARMS,2) ;
MEMNAME = SUBSTR(FILENAME,1,POS('.',FILENAME) -1) ;
INFILE = FILENAME ;
'C:\SPFPRO\SPFPRO.EXE /E 'FILENAME ;
OUTFILE = MEMNAME"2.TXT" ;
T = ""; TH= ""; TRC = 0; tcc = 0; PBLANKFLAG = 0 ;
DO WHILE LINES(INFILE) > 0 ;
T = ""; T = LINEIN(INFILE) ;
T = TRANSLATE(T,"*",X2C(07)) ;
T = TRANSLATE(T,"'",X2C(91))
T = TRANSLATE(T," ",X2C(FA))
T = TRANSLATE(T,"'",X2C(92))
T = TRANSLATE(T,"-",X2C(97))
T = TRANSLATE(T,'""',X2C(93)X2C(94))
IF OPT1 = "?" THEN OPT1 = "" ;
IF OPT1 = "C" THEN DO ;
IF WORDS(T) < 1 THEN DO
IF PBLANKFLAG = 0 THEN DO
TRC = LINEOUT(OUTFILE,TH)
TRC = LINEOUT(OUTFILE," ")
TH = ''
PBLANKFLAG = 1
END
END
ELSE DO
TH = TH' 'SPACE(T,1," ")
PBLANKFLAG = 0
END
ITERATE
END
IF OPT1 = "P" THEN DO ;
IF WORDS(T) > 0 THEN DO ;
TH = SPACE(T,1," ")
TH = STRIP(TH)
TRC = LINEOUT(OUTFILE,TH)
TRC = LINEOUT(OUTFILE," ")
TH = ""
T = ""
END
ITERATE
END
IF WORDS(T) = 1 & RIGHT(STRIP(T),1) <> "." & RIGHT(STRIP(T),1) <> '"' THEN DO
T = " "T
END
IF (LEFT(T,1) = ' ' & WORDS(T) > 0) | WORDS(T) < 1 | RIGHT(STRIP(T),1) = '.' | LEFT(T,1) = '#' | RIGHT(STRIP(T),2) = '."' | RIGHT(STRIP(T),2) = '?"' | RIGHT(STRIP(T),2) = '!"' | LEFT(STRIP(T),1) = '*' | RIGHT(STRIP(T),1) = '*' | LEFT(STRIP(T),1) = '"' THEN
DO
IF LEFT(T,1) <> ' ' & ( RIGHT(STRIP(T),1) = '.' | RIGHT(STRIP(T),2) = '."' | RIGHT(STRIP(T),2) = '?"' | RIGHT(STRIP(T),2) = '!"' | RIGHT(STRIP(T),1) = '*') THEN
DO
TH = ' 'TH' 'SPACE(T,1," ")
T = ""
END
IF WORDS(TH) > 0 THEN DO
TRC = LINEOUT(OUTFILE,STRIP(TH))
TH = " "
TRC = LINEOUT(OUTFILE," ")
END
END
IF WORDS(T) > 0 THEN T = SPACE(T,1," ")
IF (RIGHT(T,2) <> "--") & (RIGHT(T,1) = "-") THEN
DO
END
ELSE DO
T = T" "
END
TH = TH" "T
END
T = LINEOUT(OUTFILE)
'\U\DOCREADER.EXE 'OUTFILE ;
EXIT(0)