home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!rat!ucselx!crash!tech
- From: tech@crash.cts.com (Don Bontemps)
- Newsgroups: comp.lang.pascal
- Subject: I found a compiler bug in TP6.0, maybe...
- Message-ID: <1992Nov22.192602.16440@crash>
- Date: 23 Nov 92 03:26:02 GMT
- Organization: CTS Network Services (crash, ctsnet), El Cajon, CA
- Lines: 35
-
-
- When I attempt to compile the following code, I get a runtime error 202.
- It appears that I am getting an array range check error but the array index
- is within range. Here an example code listing:
-
- program range_bug;
-
-
- { Author: Donald P. Bontemps Jr.
- Date: November 22, 1992 }
-
-
- const
-
- days : array [-1..6] of string[10] = (' ','Sunday','Monday','Tuesday',
- 'Wednesday','Thursday','Friday',
- 'Saturday');
-
- num : word = 0;
-
-
- begin
-
- writeln(days[num-1]);
-
- end.
-
-
-
-
- If I turn off the compiler range checking (ie: {$R-}) the program
- executes just fine. The example code is a small portion of a large application
- that I am currently writing. If I declare num as an integer, this fixes the
- error but I need num to be declared as a word. So what gives? Is this a
- bonafide compiler bug or what? Thanks for the feedback.
-