Hi, I want to read an ascii file with records of 300 chars (variable record). I don’t utilize : FichierREP.OPEN(‘c:\ABC.txt’); FichierREP.TEXTMODE := TRUE; REPEAT FichierREP.READ(LigneREP); MESSAGE(LigneREP); UNTIL LigneREP = ‘’; FichierREP.CLOSE; What is the method to read records more than 250 chars. Thanks Ph TORRES
The only way to read text strings with >250 characters is to read byte by byte, which ist more complicated and considerably slower. First Textmode has to be set to false. Next rather than reading into a text-string, you have to read into a CHAR or Text[1]. End of Line will be determined by Chr(13)/Chr(10) and End of File in most cases by Chr(26). Are you sure you cannot use a dataport? They also support variable record length and your input file must have propper field delimiters anyway if it’s variable. If you cannot: Do you have influence on how the input file structure is being defined? If yes, I would suggest that you split the 300-char line into two lines with an identifier at the beginning. If speed is of concern you should avoid the byte-by-byte methot if possible. Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch