Newsgroups: comp.lang.pascal
Path: utzoo!utgpu!watserv1!maytag!aftermath!water!nmouawad
From: nmouawad@water.uwaterloo.ca (Naji Mouawad)
Subject: Re: Help Me!!! What's wrong with this simple problem?
Organization: University of Waterloo
Date: Wed, 28 Nov 90 18:03:10 GMT
Message-ID: <1990Nov28.180310.3147@aftermath.waterloo.edu>
References: <527@shum.UUCP> <19956@oolong.la.locus.com> <28893@shamash.cdc.com> <1990Nov28.090232.2958@uwasa.fi>
Sender: daemon@aftermath.waterloo.edu (0000-Admin(0000))
Lines: 40

In article <1990Nov28.090232.2958@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes:
>In article <28893@shamash.cdc.com> mpe@shamash.UUCP (Mike Ebsen) writes:
>>What's wrong with this problem in Turbo Pascal 5.0...
>>
>>      Program test;
>>      var
>>        i : integer;
>>        j : word;
>>      begin
>>        j:=3;
>>        i:=j-10;
>>        writeln(j,'     ',i);
>>      end.
>>
>>My compiler tells me that the assignment of -7 into i (an integer) 
>>is an error.
>
>Yes, but j-10 is a word, and you cannot assign a negative value to
>to it.  As far as I know i := j - 10 puts the value of the
>right-hand side into the left-hand side only after j-10 has been
>calculated. 
>
>...................................................................
>Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
>School of Business Studies, University of Vaasa, SF-65101, Finland
>Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

Or it may be a bug in tp5.0 . I ran this program yesterday and
I ran it today twice (with {$R+}) in tp5.5 and it ran like a
charm. No syntax errors, no sweat.

Anybody out there with tp5.5 could confirm that ? Or is my
version of tp5.5. a freak ?

--Naji
--
         ---------------+-------------------------------------------
        | Naji Mouawad  |       nmouawad@water.waterloo.edu         |
        |  University   |-------------------------------------------|
        | Of Waterloo   |   "Thank God we cannot prove He Exists."  |
