1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
SysUtils, Forms, DbCtrls, db, DBGrids, dbf, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Datasource1: TDatasource;
Datasource2: TDatasource;
Dbf1: TDbf;
Dbf1ID: TLongintField;
Dbf1LANG: TStringField;
Dbf1MTH_NAME: TStringField;
Dbf1MTH_NO: TLongintField;
Dbf2: TDbf;
Dbf2MONTH_NA: TStringField;
Dbf2ID: TLongintField;
Dbf2ID_MONTH: TLongintField;
Dbf2LANGUAGE: TStringField;
Dbf2MONTH_NO: TLongintField;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
DBLookupComboBox1: TDBLookupComboBox;
DBLookupComboBox2: TDBLookupComboBox;
DBLookupListBox1: TDBLookupListBox;
DBLookupListBox2: TDBLookupListBox;
Panel1: TPanel;
Splitter1: TSplitter;
Splitter2: TSplitter;
procedure FormShow(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormShow(Sender: TObject);
var
S: string;
I: Integer;
begin
S := Application.ExeName;
// hack for Mac
I := Pos('.app/Contents/MacOS/', S);
if (I > 0) then
S := Copy(S,1, I+3);
Dbf1.FilePath := ExtractFilePath(S)+'data'+PathDelim;
Dbf1.Open;
// Dbf1.InsertRecord([0,'GB',1,'January']);
Dbf2.FilePath := Dbf1.FilePath;
Dbf2.Open;
end;
end.
|