Read Text ascii code 13

Can anybody help me out? I already tried to read these commentlines (salesheader). Trouble is there is no possibility to read the line separator Example test.txt file COMMENT=This is tekstline1 This is tekstline2 This is tekstline3 This is tekstline4 This is tekstline5 My Codeunit example: // Open the file // You will need to have set the FileName before running the codeunit FileName := ‘C:\Temp\test.txt’; IF FileName = ‘’ THEN ERROR(‘No file to Import’); CLEAR(SOFile); SOFile.TEXTMODE := TRUE; SOFile.OPEN(FileName); // While not end of file loop and Read each line into a variable WHILE SOFile.POS <> SOFile.LEN DO BEGIN CLEAR(TextLine); CLEAR(FieldID); SOFile.READ(TextLine); // Find the position of the Token Found := STRPOS(TextLine,’=’); IF (Found <> 0) AND (STRLEN(TextLine) > Found) THEN BEGIN FieldID := COPYSTR(TextLine,1,Found - 1); TextLine := COPYSTR(TextLine,Found + 1); CASE FieldID OF ‘COMMENT’: BEGIN CR := 10; // ASC Value LF := 13; // ASC Value REPEAT Found2 := STRPOS(TextLine, FORMAT(CR,0,’’)); // // Get the ASCII Value IF Found2 <> 0 THEN BEGIN InsertComment(COPYSTR(TextLine,1,Found2 - 1)); // Now Chop the TextLine down IF STRLEN(TextLine) > Found2 THEN TextLine := COPYSTR(TextLine,Found2 + 1); END; UNTIL Found2 = 0; END; //rest of code irrelevant InsertComment(CommTextIn : Text[250]) MESSAGE(’%1’,CommTextIn); NextCommLineNo := NextCommLineNo + 10000; SalesCommLine.“Document Type” := SalesHeader.“Document Type”; SalesCommLine.“No.” := SalesHeader.“No.”; SalesCommLine.“Line No.” := NextLineNo; SalesCommLine.Date := SalesHeader.“Order Date”; SalesCommLine.Code := ‘AUTOM’; SalesCommLine.Comment := CommTextIn; SalesCommLine.INSERT;

You will not find CR LF on the textline because you open the file in TEXTMODE, thus each line of text is being assigned to textline variable one line at each read iteration. All you need to do is insert it on your comment rec. one line at a time. Try this: IF NOT SOFile.OPEN(FileName) THEN ERROR(‘Unable to open file %1’, Filename); SOFile.TEXTMODE := TRUE; while SOFile.READ(TextLine) <> 0 do InsertComment(TextLine); SOFile.CLOSE;