Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!swrinde!emory!ox.com!math.fu-berlin.de!unido!uni-koeln!news From: KHOFMANN@cipvax.biolan.Uni-Koeln.DE (Kay Hofmann) Newsgroups: comp.lang.pascal Subject: Re: Problems with Read Procedure Message-ID: <1991May21.090706.104159@rrz.uni-koeln.de> Date: 21 May 91 10:01:36 GMT References: <26937@adm.brl.mil> Sender: news@rrz.uni-koeln.de (Usenet News System) Organization: University of Cologne, FRG (Biolan) Lines: 31 In-Reply-To: GRAD205%BRFUEM.BITNET@uicvm.uic.edu's message of 20 May 91 09:06:53 GMT X-News-Reader: VMS NEWS 1.05 In <26937@adm.brl.mil> GRAD205%BRFUEM.BITNET@uicvm.uic.edu writes: > I don't know the reason ... But, the following source piece doesn't work: > > Program Test; > uses crt; > var > Name : string[12]; > Field : array[1..10] of string[10]; > n : integer; > begin > ClrScr; > Read(Name); <---------------------------- > n := 1; > repeat > Read(Field[n]); > n := n + 1; > until n = 11; > end. > > Well, this program doesn't have errors at compilation ... But when I run it, > Only Name and Field[1] are read, Field[2], Field[3], ..., Field[10] no ... > What is happening? Please, could someone help me? Supposing you wnat to enter seval strings and put them into field [1..10] each string into one array element, you should use READLN instead of READ because PASCAL otherwise starts filling field[1] and should issue an error- message if field[1] has maximum length and further input occurs. (CR and LF are interpreted as part of field[1]) Bye, Kay