Error handling during Repeat syntax

WojtekmWojtekm Member Posts: 123
Hi Guys,

I`ve wrote code like this:
IF InvoiceToImport.FIND('-') THEN BEGIN
  RecNo := InvoiceToImport.COUNT;
  Window.OPEN('.......................\' +
              '........................\' +
              '@1@@@@@@@@@@@@@@@@@@@@@@');
  REPEAT
    TestFile.OPEN('D:\'.........+'.xml');
    TestFile.CREATEINSTREAM(TestStream);
    XMLPORT.IMPORT(50000,TestStream);
    TestFile.CLOSE;
    ImportedNo := ImportedNo +1;
    Window.UPDATE(1, ROUND(ImportedNo/RecNo * 10000, 1));
  UNTIL InvoiceToImport.NEXT = 0;
  Window.CLOSE;

 END 

I dont know how to close my Dialog (var Window) in case of any error.
Now during import If i get error i still have open window in backgroung.

Any suggestion?


Regards,
Wojtek

Answers

Sign In or Register to comment.