Hello All,
I have a code unit that starts a dataport,
ObjDataport.FILENAME:=strFileName;
ObjDataport.IMPORT:=TRUE;
ObjDataport.RUNMODAL;
CLEAR(ObjDataport);
How do I know if the dataport has run with out errors
I know I can tricks about with deleting the file in the onPostDataport trigga.
But I would like to keep all this code in my code unit.
Regards Graham
0
Comments
OnPostDataport()
RunSucces := TRUE;
GetRunSuccess() : Boolean
EXIT(RunSuccess);
This was a new way of thinking... Even throw the program has ended you can still access its functions.
so now my code looks like this...
ObjDataport.FILENAME:=strFileName;
ObjDataport.IMPORT:=TRUE;
ObjDataport.RUNMODAL;
// If Dataport updated sucessfully move ASCII text file to Archive directory.
IF ObjDataport.GetRunSuccess = TRUE THEN
--CopyFile(strFileName,FormatFileName(strArchivePath,RecFiles.Name)) // OK Archive
ELSE
--CopyFile(strFileName,FormatFileName(strErrorsPath,RecFiles.Name)); // Error
CLEAR(ObjDataport);
Thx once again
Graham