[Oberon] In.Real not working

David Lightfoot dlightfoot at brookes.ac.uk
Fri Apr 9 17:55:29 CEST 2021


Dear Duke
I think you need to call procedure In.Open and Out.Open before attempting
I/O.
See page 105 onwards and Appendix C of
*Programming in Oberon *by Martin Reiser and Niklaus Wirth at
https://people.inf.ethz.ch/wirth/ProgInOberonWR.pdf

best wishes
David

On Fri, 9 Apr 2021 at 16:02, Duke Normandin <dukeofpurl at gmx.com> wrote:

>
> [code]
> In.Int(choice);
>
> CASE  choice OF
>    1 : Out.String('Enter a number/temperature TO convert: ');
>        In.Real(temp);
>        Out.Ln;Out.String("Your input was ");Out.Real(temp,3);Out.String("
> Fahrenheit!");Out.Ln;
>        Out.String("That's "); Out.Real( fahr2cels(temp),3);Out.String(" In
> Celsius!");
>
> |  2 : Out.String("Enter a number/temperature TO convert: ");
>        In.Real(temp);
>        Out.Ln;Out.String("Your input was ");Out.Real(temp,3);Out.String("
> Celsius!");Out.Ln;
>        Out.String("That's "); Out.Real(cels2fahr(temp),3);Out.String(" In
> Fahrenheit!");
> ELSE  Out.String("Sorry! Invalid Choice");
> END;
> Out.Ln;
> [/code]
>
> My program compiles w/o errors. However, In.Real(temp) in each CASE
> alternative never seems to wait for user input. The entire block of code
> for the selected "choice" gets output with garbage (of course) values.
>
> I'm stuck!  Again!! :)  Thx for any clues!
> --
> Duke Normandin <dukeofpurl at gmx.com>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>


-- 
I will be working from home for the foreseeable future. If you would like
to speak to me online, please send me an email and I will make arrangements.

David Lightfoot
Senior Lecturer in Computing
Liaison manager Informatics Academy, Singapore
Erasmus+ department coordinator

School of Engineering, Computing and Mathematics
Faculty of Technology, Design and Environment
Oxford Brookes University
Wheatley Campus
Oxford OX33 1HX
United Kingdom

+44 18 65 48 45 39

www.brookes.ac.uk/ecm/ <http://cct.brookes.ac.uk/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20210409/a00e4af8/attachment.html>


More information about the Oberon mailing list