var
i, Indx: integer;
Definition: string;
begin
for i := 0 to Table1.FieldCount - 1 do begin
Definition := Table1.Fields[i].DisplayLabel;
Definition := Definition + ' ' +
MyFieldDefs[Table1.Fields[i].DataType];
Table1.IndexDefs.Update;
if Table1.Fields[i].IsIndexField then begin
Indx := Table1.IndexDefs.Indexof(Table1.Fields[i].Name);
if Indx > -1 then
if ixPrimary in Table1.IndexDefs[Indx].Options then
Definition := Definition + ' (Primary)';
end;
Listbox1.Items.Add(Definition);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
const
MyFielddefs: array[ftUnknown..ftGraphic] of string [8] =
('Unknown', 'String', 'Smallint', 'Integer', 'Word',
'Boolean', 'Float', 'Currency', 'BCD', 'Date',
'Time', 'DateTime', 'Bytes', 'VarBytes', 'Blob',
'Memo', 'Graphic');
var
i, Indx: integer;
Definition: string;
begin
for i := 0 to Table1.FieldCount - 1 do begin
Definition := Table1.Fields[i].DisplayLabel;
Definition := Definition + ' ' +
MyFieldDefs[Table1.Fields[i].DataType];
Table1.IndexDefs.Update;
if Table1.Fields[i].IsIndexField then begin
Indx := Table1.IndexDefs.Indexof(Table1.Fields[i].Name);
if Indx > -1 then
if ixPrimary in Table1.IndexDefs[Indx].Options then
Definition := Definition + ' (Primary)';
end;
Listbox1.Items.Add(Definition);
end;
end;