0

i have this code inside repeat loop, for the first time it works just fine reads stream correctly and inserts it, but when it comes to it second time i get error that i cant read when the stream is over, but it is still inside while loop its not EOS (End Of Stream), if i remove TEXTENCODING::UTF8 even if i don't put it in while loop it works, but i need encoding otherwise the information inside stream is not correct, its in other unicode simbols. i tried using bigtext too but i can not use encoding on bigtext.

JobDescriptionL.CALCFIELDS("Minor Description");
        
JobDescriptionL."MinorDescription".CREATEINSTREAM(MinorDescStream,TEXTENCODING::UTF8);
  WHILE NOT MinorDescStream.EOS DO BEGIN
    CollapseParameter := 0;
    CellData := '';
    wdTable.Cell(J,2).Range.Collapse(CollapseParameter);
    MinorDescStream.READTEXT(CellData,1);
    wdTable.Cell(J, 2).Range.InsertAfter(CellData);
  END; 
  • Please [edit] your question to improve your [mcve]. In particular, share what do you expect and what do you get using given input stream (the latter in hex please). – JosefZ Jun 20 '23 at 15:18
  • Do you really want to read from the stream by 1 symbol at a time? Why don't you just read whole string? – Mak Sim Jun 20 '23 at 16:59
  • @MakSim i can not read full stream because it crashes navison client. – Coupe de Grace Jun 21 '23 at 08:17

1 Answers1

0

The problem was that stream was not getting disposed, i created another function and store stream in local variable and call that function in main code, this way every time stream is being disposed and it works fine.