Hi Hello
I am currently trying to get the sequence number script working –
var FileHandle: Integer;
FileName: string;
I: Integer;
Begin
FileName:='c:\1.txt';
if FileExists(FileName) then
begin
FileHandle:=FileOpen(FileName,fmOpenReadWrite);
FileRead(FileHandle,I,4);
I:=I+1;
FileSeek(FileHandle,0,0);
FileWrite(FileHandle,I,4);
FileClose(FileHandle);
end
else
begin
I:=1;
FileHandle:=FileCreate(FileName,fmOpenWrite);
FileWrite(FileHandle,I,4);
FileClose(FileHandle);
end;
SetVariable('<file_id>',LeftPad(IntToStr(i),4,'0'));
Result:=i;
end;
In running it as the first part of the package it is failing with the comment of “Failure” and no guide as to where or why.
It is creating the 1.txt file but I cannot see what is causing the failure – I have attached the log file and the txt file created by the script.
Could you please see if you can identify what is causing the error in the script
Regards,
Andrew