Nic z tego.
w tej chwili struktura tej czesci programu jest nastepujaca:
procedure TFormImport.ImportSessions(ImportFiles:TDynamicStringArray);
*with nested routines
var
(...)
F : file;
G : TLongSessionFile;
WholeSession: array of TLongSession;
(...)
*nested
function AddLongSession(Session: array of TLongSession; Name :string) : LongInt;
var
FAddLong: file of TLongSession; <<<< przedtem bylo F ale zmienilem na unikalna nazwe
i: Integer;
begin
AssignFile(FAddLong, Name+'.adl');
if FileExists(Name+'.adl') then
Reset(FAddLong) <<< jesli plik istnieje, blad jest tu
else
Rewrite(FAddLong); <<<<tu robi blad 103, ale plik jest otwierany - pojawia sie na dysku
(...)
end;
(...)
begin * of TFormImport.ImportSessions
(...)
AssignFile(F,ATDFiles[i]);
Reset(F,1); <<< OK
(...)
Reset(F,SizeOf(TLongSession)); <<<OK
(zmiana wielkosci rekordu, bez zamykania F, ale to dozwolone. Cytat z Delphi HELP, Reset:
If F is already open, it is first closed and then reopened. )
(...)
SetLength(WholeSession,FileSize(F));
for j:=0 to Pred(FileSize(F)) do
BlockRead(F,WholeSession[j], 1);
CloseFile(F);
(...)
AssignFile(G,Buffer+'.adl');
Reset(G);
(...)
CloseFile(G);
(...)
RecordNo:=AddLongSession(WholeSession, Buffer);
(...)
end; *procedure importsession
Jakies Pomysly? POMOCY!!
--Pawel
Delphi6