[Oberon] CASE statement
Chris Burrows
chris at cfbsoftware.com
Fri Apr 9 06:04:48 CEST 2021
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Duke
> Normandin
> Sent: Friday, 9 April 2021 12:42 PM
> To: oberon at lists.inf.ethz.ch
> Subject: Re: [Oberon] CASE statement
>
> On Fri, 9 Apr 2021 10:45:05 +0930
> "Chris Burrows" <chris at cfbsoftware.com> wrote:
>
> > > Is it possible to have execute a block of code - BEGIN .... END for
> > > one or more CASE alternatives? I'm trying to simulate the following
> > > C code:
>
> [snip]
>
> > Yes you can have blocks of code (multiple statements) in each CASE
> > alternative in an Oberon-2 program. For example the CASE example in
> > the Oberon-2 Report is:
>
> Yes! I've read the Report and ALL the other docs, but NONE of them speak
of
> the option to have multiple statements in a CASE alternative. None that I
> could stumble across anyway.
>
> [snip]
>
> > However you don't need both BEGIN and END if the case has more than
> > one statement. The BEGIN is redundant. The end of each block is
> > indicated by "|", "ELSE" or "END" e.g.
>
> That's why I'm grateful for the example your cobbled together for me! Much
> obliged. Thx!!
>
No problem! I recommend that you get yourself a copy of the book "Into the
Realm of Oberon" by Eric Nitikin:
https://www.springer.com/gp/book/9781461274919
This book includes an example of CASE with multiple statements,
Regards,
Chris Burrows
CFB Software
https://www.astrobe.com/
More information about the Oberon
mailing list