Path: utzoo!mnetor!uunet!husc6!mailrus!ames!pacbell!att-ih!ihnp4!inuxc!iuvax!bsu-cs!neubauer From: neubauer@bsu-cs.UUCP (Paul Neubauer) Newsgroups: comp.lang.pascal Subject: Re: HELP! Turbo Pascal v2.0 problem on Zeniths Message-ID: <2415@bsu-cs.UUCP> Date: 19 Mar 88 20:35:43 GMT References: <12503@brl-adm.ARPA> Reply-To: neubauer@bsu-cs.UUCP (Paul Neubauer) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 29 In article <12503@brl-adm.ARPA> rbw@WILLIAMS.edu writes: +Your code: +> for Indx := 1 to 8 do +> Title := Title + ElName[Indx]; *** error occurs on ; *** +> writeln (Lst, 'xxx'); + +Why not replace this fragment with the equivalent + +Title:=Title + copy(Elname,1,8); + +or even (for the purists) +Title:=concat(Title,copy(Elname,1,8)); + +This would put the potentially offending code back in the intrinsic +function department, and that is assumed to be correct ;-). Considering that the type of Title was string[8], what is going on here is that he is trying to start from a blank title and fill ALL 8 characters of it from Elname. So an even more sensible thing for the purist to do would be: Title := copy(Elname,1,8); This would also make SURE that he is not actually concatenating onto something that is already there due to lack of range checking by Turbo. (N.B. range checking is OFF by default in Turbo.) -- Paul Neubauer neubauer@bsu-cs.UUCP !{iuvax,pur-ee,uunet}!bsu-cs!neubauer