unit MtnNo;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls,gtfunc,GlobalVar;

type
  TGetMtnNo = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
  nMtnNo:Word;
    { Public declarations }
  end;

var
  GetMtnNo: TGetMtnNo;

implementation

{$R *.dfm}

procedure TGetMtnNo.Timer1Timer(Sender: TObject);
begin
  GT_GetMtnNm(@nMtnNo);
  Edit1.text:=IntToStr(nMtnNo);  
end;

procedure TGetMtnNo.FormShow(Sender: TObject);
begin
  if lang=1 then
  begin
      Label1.Caption:='缓冲区当前执行段号';
      button1.Caption:='确定(&o)';
      caption:='执行段号';
  end  else  begin
      Label1.Caption:='the current executer num';
      button1.Caption:='Confirm(&o)';
      caption:='GetMtnNm';
  end;
  rtn:=GT_GetMtnNm(@nMtnNo);
  if rtn=0 then
     Edit1.text:='0'
  else
     Edit1.text:=IntToStr(nMtnNo);
  Timer1.Enabled:=true;
end;

procedure TGetMtnNo.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Timer1.Enabled:=false;
end;

end.
