<div dir="ltr"><br><br>On Mon, Jan 24, 2022 at 11:14 AM Joe Turner <<a href="mailto:medianjoe@mailfence.com">medianjoe@mailfence.com</a>> wrote:<br>><br>> 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):<br>><br>> MODULE case;<br>> IMPORT In,Out;<br>><br>> VAR countVowels: INTEGER; ch: CHAR;<br>><br>> BEGIN<br>>   In.Open;<br>>   countVowels:=0;<br>>   LOOP<br>>     In.Char(ch);<br>>     IF ~In.Done THEN EXIT END;<br>>     CASE ch OF<br>>       "a", "e", "i", "o", "u",<br>>       "A", "E","I","O","U": INC(countVowels)<br>>     ELSE<br>>     END;<br>>   END;<br>>   Out.Int(countVowels,0);<br>>   Out.String(" vowels read.");Out.Ln;<br>> END case.<br>><br>> Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE.<br>> Thanks in advance for any help.<br><div>></div><div><br></div><div>
<div>Hi Joe,<br></div><div>One way for you to use Oberon-2 syntax is to employ BlackBox Component Pascal Environment:</div><div><a href="https://blackboxframework.org/index.php?cID=home,en-us">https://blackboxframework.org/index.php?cID=home,en-us</a></div><div>One public domain good book for practicing with BB CP is this:</div><div><a href="https://cslab.pepperdine.edu/warford/ComputingFundamentals/">https://cslab.pepperdine.edu/warford/ComputingFundamentals/</a></div><div>And its resources:</div><div><a href="http://www.zinnamturm.eu/downloadsOS.htm#Pbox">http://www.zinnamturm.eu/downloadsOS.htm#Pbox</a></div><div><br></div><div>Another way to use Oberon-2 syntax is to employ Oberon System 3 with Gadgets under Windows or Linux:</div><div><a href="https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Win95NT">https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Win95NT</a></div><div><a href="https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Unix">https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Unix</a></div><div><br></div><div>In BlackBox your program counts the vowels on the viewer from where it is called. <br></div><div>In Oberon System 3, it counts the vowels after the command line in any viewer.</div><div></div><div>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:</div><div><br></div><div>MODULE Case;<br>IMPORT In,Out;<br><br>VAR countVowels: INTEGER; ch: CHAR;<br><br>PROCEDURE Vowcount *;<br>BEGIN<br>  In.Open;<br>  countVowels:=0;<br>  LOOP<br>    In.Char(ch);<br>    IF ~In.Done THEN EXIT END;<br>    CASE ch OF<br>      "a", "e", "i", "o", "u",<br>      "A", "E","I","O","U": INC(countVowels)<br>    ELSE<br>    END;<br>  END;<br>  Out.Int(countVowels,0);<br>  Out.String(" vowels read.");Out.Ln;<br>    END Vowcount;<br>END Case.</div>

</div><div><br></div><div>Best regards,</div><div>Prof Pablo Cayuela</div><div>Argentina</div><div><br></div></div>