Android smartphone

2009-10-11

Remove a dbase index flag


Author: Alex Carrillo

function UnCheckIndex( FileDbf: String ): Boolean;
var
Dbf: File;
Car: Char;
begin
Result:= T;
AssignFile( Dbf, FileDbf );
Car := #0;
{$I-}
Reset(Dbf, 1);
If Not ErrorIO( FileDbf, IoResult ) then

Begin
Seek(Dbf, 28);
{Flag's position}
If Not ErrorIO( FileDbf, IoResult ) then
BlockWrite( Dbf, Car, 1, Num_R )
Else
Result:= F;
CloseFile(Dbf);
If ErrorIO( FileDbf, IoResult ) then
Result:= F;
End
Else
Result:= F;
{$I+}
End;

procedure TForm1.Button1Click(Sender: TObject);
begin
If
UnCheckIndex('MyBase.dbf') Then
ShowMessage('Flag removed');
end;




Hotmail: Trusted email with Microsoft's powerful SPAM protection. Sign up now.

No comments: