function gettxt(ffile: string): string;
var
hFile: DWORD;
iSize: DWORD;
begin
hFile := CreateFile(PChar(ffile), GENERIC_READ, 3, nil,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
iSize := GetFileSize(hFile, nil);
SetLength(Result, iSize+1);
ReadFile(hFile, Result[1], iSize, iSize, nil);
CloseHandle(hFile);
Result := string(PChar(Result));
end;
function settxt(ffile, str: string): string;
var f:textfile;
begin
//
assignfile(f,ffile);
rewrite(f);
write(f,str);
closefile(f);
end;
var
hFile: DWORD;
iSize: DWORD;
begin
hFile := CreateFile(PChar(ffile), GENERIC_READ, 3, nil,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
iSize := GetFileSize(hFile, nil);
SetLength(Result, iSize+1);
ReadFile(hFile, Result[1], iSize, iSize, nil);
CloseHandle(hFile);
Result := string(PChar(Result));
end;
function settxt(ffile, str: string): string;
var f:textfile;
begin
//
assignfile(f,ffile);
rewrite(f);
write(f,str);
closefile(f);
end;