Correction; ORD usage & etc.
From: peter at easthope.ca (Peter Easthope), Fri, 16 Oct 2015 18:39:58 -0500
menuH := Fonts.Default.height + 2; barW := menuH; INC(menuH, ORD(Modern) * 6);
The argument of ORD is CHAR; not BOOLEAN. This is more likely to succeed. (* Kronecker delta *) PROCEDURE Kd(b: BOOLEAN): INTEGER; BEGIN IF b THEN RETURN 1 ELSE RETURN 0 END END Kd; ... INC(menuH, Kd(Modern) * 6); The genuine Kronecker delta tests equality of two arguments. So this is a distortion; but understandable. Regards, ... Lyall E. -- 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12 Tel +1 360 639 0202 http://easthope.ca/Peter.html Bcc: peter at easthope. ca
-----Original Message----- From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of peter@easthope.ca Sent: Sunday, 31 January 2016 6:11 AM To: oberon@lists.inf.ethz.ch Subject: [Oberon] Correction; ORD usage & etc.
From: peter at easthope.ca (Peter Easthope), Fri, 16 Oct 2015 18:39:58 -0500
menuH := Fonts.Default.height + 2; barW := menuH; INC(menuH, ORD(Modern) * 6);
The argument of ORD is CHAR; not BOOLEAN. This is more likely to succeed.
(* Kronecker delta *) PROCEDURE Kd(b: BOOLEAN): INTEGER; BEGIN IF b THEN RETURN 1 ELSE RETURN 0 END END Kd; ... INC(menuH, Kd(Modern) * 6);
Unless I'm missing some obscure trickery, I find that the following leads to less mental gymnastics for me: menuH := Fonts.Default.height + 2; barW := menuH; IF Modern THEN INC(menuH, 6) END; Regards, Chris
participants (2)
-
Chris Burrows -
peter@easthope.ca