Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!news.funet.fi!uwasa.fi!ts From: ts@uwasa.fi (Timo Salmi) Newsgroups: comp.lang.pascal Subject: Re: Help Me!!! What's wrong with this simple problem? Message-ID: <1990Nov28.090232.2958@uwasa.fi> Date: 28 Nov 90 09:02:32 GMT References: <527@shum.UUCP> <19956@oolong.la.locus.com> <28893@shamash.cdc.com> Organization: University of Vaasa Lines: 25 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