Board index » delphi » Q: Reading > 255 char

Q: Reading > 255 char

-=[ In:guenther.bosch@campusa was heard to say... ]=-

 In> I want to read lines out of a file which contains more than 255 chars
 In> per line. So I think I have to use Zero terminated Strings.
 In> So, what are the right type definitions for the following line ?

 In> Readln (InFile,LineString);

 In> Guenther.Bo...@campusart.com

You will not be able to use ReadLn(), since it is for text files only,
and will not work on user defined types, which is what you will need for
your purposes. Read() however will work, but there is still a problem
with having it detect the null termination in your user defined string
type. I don't think there is a simple solution for doing what you want to
do.

        -- Kim Forwood --

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\
  $           Kim Forwood  <kim.forw...@access.cn.camriv.bc.ca>          %
  %         For what purpose is life, if one cannot live freely?         $
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/

___ Blue Wave/QWK v2.20

 

Re:Q: Reading > 255 char


Quote
Kim.Forw...@access.cn.camriv.bc.ca (Kim Forwood) wrote:
>-=[ In:guenther.bosch@campusa was heard to say... ]=-
> In> I want to read lines out of a file which contains more than 255 chars
> In> per line. So I think I have to use Zero terminated Strings.
> In> So, what are the right type definitions for the following line ?
> In> Readln (InFile,LineString);
> In> Guenther.Bo...@campusart.com
>You will not be able to use ReadLn(), since it is for text files only,
>and will not work on user defined types, which is what you will need for
>your purposes. Read() however will work, but there is still a problem
>with having it detect the null termination in your user defined string
>type. I don't think there is a simple solution for doing what you want to
>do.
>        -- Kim Forwood --
>  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\
>  $           Kim Forwood  <kim.forw...@access.cn.camriv.bc.ca>          %
>  %         For what purpose is life, if one cannot live freely?         $
>  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/
>___ Blue Wave/QWK v2.20

Please access Borland's TechFax at (800)822-4269 and request document
2645.

Borland's response to -
How can I readln() from a file when the lines are longer than 255
characters?

Other Threads