English 中文(简体)
Delphi TStringList efcreate, file used by another process
原标题:Delphi TStringList efcreate error, file used by another process

在任何地方进行搜捕,但我看不到这项工作。 当我操作该法典时,我收到一份ESCreateError告诉我,该档案被另一个程序使用。 我对使用TStringList说,我需要你们的帮助! 提前感谢!

这是产生错误之处:即时。 Save ToFile ( DataEmp +emp+emp+ emp+ .txt );

procedure TfmMain.btSaveRetClick(Sender: TObject);
var
    select, pos1, pos2, pos3, i: integer;
    fileBuffer, rentFile: TextFile;
    rCode, emp, buffer, retBuffer: string;
    empFile: TStringList;

begin
    if lbReturn.Items.Count <> 0 then 
    begin
        select:=Messagedlg( Retourner les items? , mtConfirmation, [mbYes, mbNo],0);
        if select=mrYes then 
        begin
            empFile:=TStringList.Create;
            AssignFile(fileBuffer,  Datafilebuffer.dat );
            AssignFile(rentFile,  Data
ented.dat );
            lbReturn.Items.SaveToFile( Datafilebuffer.dat );
            Reset(fileBuffer);
            Reset(rentFile);

            repeat 
            begin
                ReadLn(fileBuffer, buffer);
                pos1:=AnsiPos( | , buffer);
                rCode:=AnsiLeftStr(buffer, pos1-2);
                repeat 
                begin
                    ReadLn(rentFile, retBuffer);
                    pos2:=AnsiPos(rCode, retBuffer);
                    if pos2<>0 then 
                    begin
                        pos3:=AnsiPos( | , retBuffer);
                        emp:=AnsiRightStr(retBuffer, (Length(retBuffer))-pos3-1);
                        empFile.LoadFromFile( DataEmp +emp+  +emp+ .txt );
                        i:=empFile.IndexOf(buffer);
                        empFile.Delete(i);
                        empFile.SaveToFile( DataEmp +emp+  +emp+ .txt );
                        empFile.Clear;
                    end;   
                end;
                until EOF(rentFile);
            end;
            until EOF(fileBuffer);
        empFile.Free;
        end;
    end 
    else 
    begin
        MessageDlg( Aucun item à enregistrer! , mtError, [mbOK], 0);
    end;
end;
最佳回答

EFCreate http://docwiki.embarcadero.com/VCL/en/Classes.EFCreateError”rel=“nofollow”

问题回答

暂无回答




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签