<div style='font-family:arial; font-size:13px;'><div>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):</div><div><br></div><div>MODULE case;</div><div>IMPORT In,Out;</div><div><br></div><div>VAR countVowels: INTEGER; ch: CHAR;</div><div><br></div><div>BEGIN</div><div> In.Open;</div><div> countVowels:=0;</div><div> LOOP</div><div> In.Char(ch);</div><div> IF ~In.Done THEN EXIT END;</div><div> CASE ch OF</div><div> "a", "e", "i", "o", "u",</div><div> "A", "E","I","O","U": INC(countVowels)</div><div> ELSE</div><div> END;</div><div> END;</div><div> Out.Int(countVowels,0);</div><div> Out.String(" vowels read.");Out.Ln;<br></div><div>END case.</div><div><br></div><div>Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. <br></div><div>Thanks in advance for any help.<br></div></div>
--
Sent with https://mailfence.com
Secure and private email