CompuServe Messages

TDI Modula v2 issues

#: 35817 S7/ProgrammingForum unknown
    09-Oct-86 22:17:17
Fm: Steve Faiwiszewski 74106,425
To: Steve Faiwiszewski 74106,425

This message turned up in search, but its forum couldn’t be identified from the original transcript, so it may not be linked into its thread.

Here's the sample program to demonstrate the function comparison bug: MODULE ppp; (**************************************************************************** * This little program demonstrates the bug in the TDI compiler v2.20 which * * messes up on comparison of functions. * ****************************************************************************) (* *) FROM InOut IMPORT WriteString, WriteLn, WriteInt, ReadInt; (* *) VAR x,y : INTEGER; (* *) PROCEDURE FooInt(n : INTEGER): INTEGER; BEGIN RETURN(n) END FooInt; (* *) BEGIN REPEAT WriteString('Enter x, y: '); ReadInt(x); ReadInt(y); WriteString('Integer test:'); WriteLn; WriteString('x = '); WriteInt(x,1); WriteString(' y = '); WriteInt(y,1); WriteLn; WriteString('FooInt(x) = '); WriteInt(FooInt(x),1); WriteString(' FooInt(y) = '); WriteInt(FooInt(y),1); WriteLn; IF FooInt(x) < FooInt(y) THEN WriteString('FooInt(x) < FooInt(y)') ELSIF FooInt(x) > FooInt(y) THEN WriteString('FooInt(x) > FooInt(y)') ELSE WriteString('FooInt(x) = FooInt(y)') END; WriteLn; WriteLn; UNTIL x = -999; END ppp.