Microsoft KB Archive/23610

PAS2 Hangs from ORing Complimentary String Comparisons PSS ID Number: Q23610 Article last modified on 03-01-1991 PSS database name: S_PasCal

3.3x

MS-DOS

Question:

When the results of complementary string comparisons are ORed together in an expression used to control an IF or WHILE construct in a program, the PAS2.EXE program hangs up. The only way to recover is to reboot the computer. An example of such an offending line is “IF (x=y) or (x<>y) THEN…” [where x and y are of type STRING(2)].

This problem does not occur with the AND operator. Any complementary pair of relational operators (for example, “=” and “<>”, “<” and “=>”, or “>” and “=<”), seem to cause the problem, although operators such as “<” and “>” do not. The problem seems to occur only when the whole expression evaluates to true for all values, and only with a two-term expression; a three-term expression that is always true compiles.

Response:

Microsoft has confirmed this to be a problem in version 3.32. This problem was corrected in Microsoft Pascal version 4.00.

Copyright Microsoft Corporation 1991.