Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!pegasus!psrc From: psrc@pegasus.ATT.COM (Paul S. R. Chisholm) Newsgroups: comp.sys.ibm.pc Subject: Re: Various Turbo pascal questions Summary: reading all of a long line at once? Keywords: Turbo pascal Message-ID: <4269@pegasus.ATT.COM> Date: 24 Nov 89 20:30:35 GMT References: <2185@leah.Albany.Edu> <6972@portia.Stanford.EDU> Organization: AT&T Bell Laboratories Lines: 23 > In article <2185@leah.Albany.Edu> ppd491@leah.Albany.Edu (Peter P. Donohue) writes: > 1) In an external data file (containing all ascii data), what is the > maximum length of a line allowed? In article <1989Nov23.183325.4549@uwasa.fi>, ts@uwasa.fi (Timo Salmi LASK) writes: > If you use ordinary strings the maximum is only 255 characters. > You can make it as long as 64K allows by adapting > var line : array [maxlengt] of char; > There are some good "LongString" routines in O'Brien, Turbo Pascal, > the Complete Reference. In article <6972@portia.Stanford.EDU>, gaia@portia.Stanford.EDU (fai to leung) writes: > I would say 255 characters long. > Pascal strings format are byte[0]=length of string follow by the ascii chars. Yes, if you try to read the whole line in at once. If you read() each character one at a time, and don't need the whole line in memory at the same time, is there a limit? (I would hope not, but TP might do some internal buffering.) Peter, you might try this yourself. Paul S. R. Chisholm, AT&T Bell Laboratories att!pegasus!psrc, psrc@pegasus.att.com, AT&T Mail !psrchisholm I'm not speaking for the company, I'm just speaking my mind.