[Oberon] Bit-fiddling: SETs and type casts in Oberon-07

Chris Burrows cfbsoftware at gmail.com
Sun Aug 7 03:48:33 CEST 2022


On Sun, Aug 7, 2022 at 11:14 AM Chris Burrows <cfbsoftware at gmail.com> wrote:

>
>> Oops!
>
>  IF (ch >= "a") & (ch <= "z") THEN cap := CHR(ORD(ch) - 32) ELSE cap := ch
> END;
>

Third time lucky? ;-)

  PROCEDURE CAP(ch: CHAR): CHAR;
  BEGIN
    IF (ch >= "a") & (ch <= "z") THEN ch := CHR(ORD(ch) - 32) END;
    RETURN ch
  END CAP;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20220807/03dc61dc/attachment.html>


More information about the Oberon mailing list