[Oberon] How to write this program in Oberon-07?
medianjoe at mailfence.com
Tue Jan 25 09:14:05 CET 2022
Many thanks for the links. I wasn't aware of Blackbox or component Pascal. I use Linux but it seems to work flawlessly with Wine. The book looks really good too.
January 24, 2022 8:19:02 PM CET Pablo Cayuela <pablo.cayuela at gmail.com> wrote:
On Mon, Jan 24, 2022 at 11:14 AM Joe Turner <medianjoe at mailfence.com> wrote:
> I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler):
> MODULE case;
> IMPORT In,Out;
> VAR countVowels: INTEGER; ch: CHAR;
> IF ~In.Done THEN EXIT END;
> CASE ch OF
> "a", "e", "i", "o", "u",
> "A", "E","I","O","U": INC(countVowels)
> Out.String(" vowels read.");Out.Ln;
> END case.
> Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE.
> Thanks in advance for any help.
One way for you to use Oberon-2 syntax is to employ BlackBox Component Pascal Environment:
One public domain good book for practicing with BB CP is this:
And its resources:
Another way to use Oberon-2 syntax is to employ Oberon System 3 with Gadgets under Windows or Linux:
In BlackBox your program counts the vowels on the viewer from where it is called.
In Oberon System 3, it counts the vowels after the command line in any viewer.
I've only modified your program puting the executable part inside a procedure to call it from any viewer inside of Oberon System 3 or BlackBox CP:
VAR countVowels: INTEGER; ch: CHAR;
PROCEDURE Vowcount *;
IF ~In.Done THEN EXIT END;
CASE ch OF
"a", "e", "i", "o", "u",
"A", "E","I","O","U": INC(countVowels)
Out.String(" vowels read.");Out.Ln;
Prof Pablo Cayuela
Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
-- Sent with https://mailfence.com Secure and private email
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Oberon