unit Unit1; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  DbCtrls, db, DBGrids, StdCtrls, dbf, memds, 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
    { private declarations }
  public
    { public declarations }
  end; 

var
  Form1: TForm1; 

implementation

{ 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;

initialization
  {$I unit1.lrs}

end.

