<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Chris,<br>
This V4 code seems to work!<br>
Needing to cast a BYTE using ORD threw me for a while. You don't
need to do<br>
that with Component Pascal.<br>
<br>
MODULE Foo;<br>
<br>
IMPORT<br>
Files,<br>
SYSTEM;<br>
<br>
VAR<br>
rd: Files.Rider;<br>
wr: Files.Rider;<br>
inFile: Files.File;<br>
outFile: Files.File;<br>
<br>
PROCEDURE Open* (out, in: ARRAY OF CHAR): BOOLEAN;<br>
VAR flag: BOOLEAN;<br>
BEGIN<br>
inFile := Files.Old(in);<br>
flag := (inFile # NIL);<br>
IF flag THEN<br>
Files.Set(rd, inFile, 0);<br>
outFile := Files.New(out);<br>
flag := (outFile # NIL);<br>
IF flag THEN<br>
Files.Set(wr, outFile, 0)<br>
END<br>
END;<br>
RETURN flag<br>
END Open;<br>
<br>
PROCEDURE Strip* ;<br>
VAR b: SYSTEM.BYTE;<br>
BEGIN<br>
Files.Read(rd, b);<br>
WHILE ~rd.eof DO<br>
IF (ORD(b) = 13) OR (ORD(b) = 10) THEN b := 32 END;<br>
Files.Write(wr, b);<br>
Files.Read(rd, b);<br>
END;<br>
Files.Register(outFile);<br>
Files.Close(inFile)<br>
END Strip;<br>
<br>
PROCEDURE Test*;<br>
BEGIN<br>
IF Open("TestOut.Mod", "TestIn.Mod") THEN Strip END;<br>
END Test;<br>
<br>
END Foo.Test << middle mouse click there to run the program
<br>
<br>
TestIn.Mod looks like<br>
This is a<br>
sentence with lots<br>
of line breaks.<br>
Hope this<br>
works!<br>
<br>
TestOut.Mod looks like<br>
This is a sentence with lots of line breaks. Hope this works!<br>
<br>
-Doug<br>
<div class="moz-cite-prefix">On 11/27/2016 10:40 PM, eas lab wrote:<br>
</div>
<blockquote
cite="mid:CAN3-DLG7SF3+zBW09hAwStYE4LkpNfU07_RmY5oDZ_SDonyDTQ@mail.gmail.com"
type="cite">
<pre wrap="">2 apparently independant Windows bases TextToSpeech translator, both
absurdly pause at the text's <newlines>, making the speech sound bad.
Linux fixes that with:--
# remove all EOL : \n = new line; \r = return
#tr -d \n | tr -d \r \NNN :Octal 10+2=> 012; 13=8+5=>015; 32=\040
cat $1 | tr -d "\012" | tr -d "\015" | \
sed 's/\./\.\r\n/g' | sed 's/ / /g' >> $2
# CrLf after each period & double-space to single-space <-irrelevant
But I currently can't get inet except via M$, and I can't afford
to switch to *nix for trivial tasks which I can't do with M$!!
Since Oberon V4 is running in M$, I thought of:
OpenInfile; OpenOutfile;
FOR Char:=NextByte(Infile)
IF (Ord(Char) = 10) OR (Ord(Char) = 13)
THEN Write(Outfile, Ord(32)
ELSE Write(Outfile, Char END;
CloseInfile; CloseOutfile.
You can see that I'm no longer fluent/familiar with <Algol> ?!
My ETHO documentation is lost/destroyed, and it's pointless to
collect replacements it [since I need to stay dependent on a M$
laptop, to easily flee as the 'revolution' progresses];
but I remember that per S3 documentation:
opening & closing files involved <riders>.
Can someone please sketch some V4 syntax to solve this problem,
since I've really only installed V4 for the <ability to access
multiple text files together on the same screen>; which apparently
is beyond the imagination of the M$ designers.
Thanks,
== Chris Glur.
PS. I looked at M$'s good idea to follow *nix's shell idea,
but you can see that M$'s founder has lawer ancestors: who have
the lawer's moto "if ten thousand words will do, why use ten".
--
<a class="moz-txt-link-abbreviated" href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems
<a class="moz-txt-link-freetext" href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Danforth of the Greenwood</pre>
</body>
</html>