Hi,
I am compiling a dynamic simulation model (written in Turbo Pascal) in Delphi. I can get the model to run but I'm getting an IOResult (32) error (sharing violation / 'The process cannot access the file because another process has locked a portion of the file') after the 'Reset' procedure when the model attempts to load one of the input files for the model (the model can still run without this input file but the output is not correct). Any advice on how to track down the process that has locked the file and fix this problem would be greatly appreciated. Thanks.
The function that is generating the IOResult=32 is below:
function Exist(Filename:string):boolean;
var
myFil : file;
bool : boolean;
errorcode : string;
begin
Assign (myFil,Filename);
{$I-}
Reset(myFil);
CloseFile(myFil);
{$I+}
bool := (IOresult = 0);
Exist := bool;
if not bool then ok:= false;
end; {function Exist}