Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!dslg0849 From: dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) Newsgroups: comp.lang.pascal Subject: Re: Help Me!!! What's wrong with this simple problem? Message-ID: <1990Nov28.100808.20170@ux1.cso.uiuc.edu> Date: 28 Nov 90 10:08:08 GMT References: <527@shum.UUCP> <19956@oolong.la.locus.com> <28893@shamash.cdc.com> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 21 mpe@shamash.cdc.com (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. You could use typecasting to fix the offending line as follows: i := Integer(j) - 10; Daniel Lewart d-lewart@uiuc.edu