FileContent Binary (2000) BytesRead Integer FilePos Integer FieldNo Integer FeedFile.TEXTMODE(FALSE); FeedFile.OPEN(FileName); FieldNo := 1; REPEAT BytesRead := FeedFile.READ(FileContent); FilePos := 0; REPEAT FilePos += 1; varMsg := FORMAT(FileContent[FilePos]); CASE FileContent[FilePos] OF 9 : FieldNo += 1; // TAB 13 : BEGIN // CR CreateHeaderRecord; FieldNo := 1; FilePos += 1; // CR is two END; ELSE BEGIN CASE FieldNo OF 1 : Field1 := Field1 + FORMAT(FileContent[FilePos]); 2 : Field2 := Field2 + FORMAT(FileContent[FilePos]); 3 : Field3 := Field3 + FORMAT(FileContent[FilePos]); 4 : Field4 := Field4 + FORMAT(FileContent[FilePos]); 4 : varBigText.ADDTEXT(FORMAT(FileContent[FilePos])); END; END; END; UNTIL FilePos = BytesRead; UNTIL FeedFile.POS = FeedFile.LEN;Since that FileContent variable is binary set to the 2000 max, once I exceed the 2000 max I get an array is outside the permitted range error. Makes senese, but I'm struggling with a different method or how to restructure this code to work. I welcome any suggestions or ideas.
Comments
The code below should give you some idea how to work it.
This dataport exports or imports some columns on the item table and the item picture as a hexdump.
TVision Technology Ltd