home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6836 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.5 KB

  1. Path: sparky!uunet!noc.near.net!bigboote.WPI.EDU!wpi.WPI.EDU!gregs
  2. From: gregs@wpi.WPI.EDU (Floppy)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: I found a compiler bug in TP6.0, maybe...
  5. Date: 23 Nov 1992 16:07:01 GMT
  6. Organization: Worcester Polytechnic Institute
  7. Lines: 35
  8. Message-ID: <1eqvj5INNprl@bigboote.WPI.EDU>
  9. References: <1992Nov23.061222.3675@u.washington.edu> <JgLouB1w165w@abyss.wa.com>
  10. NNTP-Posting-Host: wpi.wpi.edu
  11.  
  12. In article <JgLouB1w165w@abyss.wa.com> milton@abyss.wa.com (Steve Milton, Sysop) writes:
  13. >nobby@byron.u.washington.edu (Vitaly Shmatikov) writes:
  14. >
  15. >> In article <1992Nov22.192602.16440@crash> tech@crash.cts.com (Don Bontemps) w
  16. >> >
  17. >> >When I attempt to compile the following code, I get a runtime error 202.
  18. >[Some lines deleted.]
  19. >> >
  20. >> >  num : word = 0;
  21. >> >
  22. >> >
  23. >> >begin
  24. >> >
  25. >> >  writeln(days[num-1]);
  26. >> >
  27. >> >end.
  28. >> >
  29. >> >
  30. >> 
  31.     This really is a bug.  The manual clearly states that when an
  32. arithmetic expression contains two integral types, both numbers will first be
  33. converted to the smallest integral type containing the entire range of both of 
  34. the original types.  In this case, the smallest such type is longint, since
  35. the two original types were word and shortint.
  36.  
  37. Greg
  38.  
  39. +-------+   Greg Snyder  alias Floppy alias Brocolli Man  IS  gregs@wpi.wpi.edu
  40. |       [       [Witty quote ommitted until further notice] *:^)
  41. |   O   |    
  42. |   | ` |          Worcester Polytechnic Institute, Worcester MA 
  43. +-------+   --------------------------------------------------------------
  44.  
  45.  
  46.  
  47.