procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(IntToStr(Dbf1.RecordCount));
end;
procedure TForm1.Button2Click(Sender: TObject);
var
s: TStrings;
begin
s := TStringList.Create;
Dbf1.GetFieldNames(s);
ShowMessage(s.Text);
s.Free;
end;
procedure TForm1.Button3Click(Sender: TObject);
function DosToWin(s: string): string;
var
b: TBytes;
begin
b := BytesOf(s);
b := TEncoding.Convert(TEncoding.GetEncoding(866), TEncoding.GetEncoding(1251), b);
Result := StringOf(b);
end;
var
fieldlist: TFieldList;
i: Integer;
s: string;
begin
fieldlist := Dbf1.FieldList;
//Dbf1.RecNo := 0;
for i := 0 to fieldlist.Count-1 do
s := s + fieldlist[i].FieldName{FullName} +
' (' + DosToWin(fieldlist[i].Text) + ')'#13;
ShowMessage(s);
end;
uses
TypInfo;
procedure TForm1.Button4Click(Sender: TObject);
var
fields: TFields;
i: Integer;
s: string;
begin
fields := Dbf1.Fields;
//Dbf1.RecNo := 0;
for i := 0 to fields.Count-1 do
s := s + fields[i].FieldName{FullName} +
' (' + GetEnumName(TypeInfo(TFieldType), Ord(fields[i].DataType)) + ')'#13;
ShowMessage(s);
end;
procedure TForm1.Button5Click(Sender: TObject);
var
Buffer: TValueBuffer;
begin
Dbf1.RecNo := 100;
SetLength(Buffer, 100);
Dbf1.GetFieldData(1, Buffer); // Нумерация полей начинается с 1
Buffer := TEncoding.Convert(TEncoding.GetEncoding(866), TEncoding.GetEncoding(1251), Buffer);
ShowMessage(StringOf(Buffer));
end;