Date : Wed, 10 Apr 1985 12:42:44 pst
From : Samuel Lam <SKLM%mtsg.ubc.cdn%ubc.csnet@CSNET-RELAY.ARPA>
Subject: carriage returns in wordstar
The following has been taken, verbatim, from the May 1984 issue of the
UBC Computing Centre Newsletter, published by the Computing Centre,
University of British Columbia.
It should solve your problem with carriage return and WordStar.
... Samuel Lam
CDNnet: SKLM@mtsg.ubc.cdn
Mailnet: Samuel_Lam@UBC.Mailnet
_____________________________________________
WORDSTAR FILES AND CARRIAGE RETURNS
-- Glen Cooper
FMT to WordStar users have been encountering
a bothersome problem--every time they down-
load the former to the latter each line ends
in a hard carriage return (making WordStar
think every line is its own paragraph).
WordStar normally ends each line with a
"soft" carriage return (8D hex) as well as a
line feed (0A hex), but for any line which
happens to be at the end of a paragraph, the
soft carriage return is made "hard" (0D hex)
by having the higher-order bit turned off.
This difference is required because WordStar
justifies paragraphs, not line ranges, and
the program needs to know where each para-
graph ends.
Unfortunately, WordStar does not distinguish
between soft and hard returns in its editing
commands so users cannot easily make hard
returns soft. MicroPro suggests deleting the
hard returns and reformatting. This can be
very tedious when large files produced by
other programs need to edited by WordStar and
all the returns are hard. For example, files
produced on a mainframe and downloaded onto a
microcomputer by a communications program may
only have hard returns.
An easier way around this problem is demon-
strated in the following MicroSoft Basic
program which takes a file on drive B (called
HARD) and transforms it into a new file on
drive B (called SOFT) where all carriage re-
turns are made soft:
100 REM
110 REM from hard to soft carriage returns
120 REM
130 OPEN "I",#1,"B:HARD"
140 OPEN "O",#2,"B:SOFT"
150 IF EOF(1) GOTO 190
160 LINE INPUT #1,L$
170 PRINT #2,L$+CHR$(141)+CHR$(10);
180 GOTO 150
190 END
Note that this program assumes each line of
B:HARD ends in a hard carriage return.
After running the program you can then use
WordStar to mark the end of paragraphs by
hitting the return key anywhere on those
lines which end them (making sure insert mode
is off to avoid unwanted line breaks).
Another way to do this would be to end each
paragraph beforehand with a special symbol
(i.e., one which is not used for anything
else in the file) and then use WordStar's
global find and replace command to change all
special symbols to hard returns.