unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Label1: TLabel;
    Timer1: TTimer;
    procedure FormCreate(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
if radiobutton1.Checked then
label1.Caption :=formatdatetime('ampmhh:nn:ss',time)
else
label1.Caption :=formatdatetime('hh:nn:ss',time);end;procedure TForm1.RadioButton1Click(Sender: TObject);
begin
Timer1timer(sender);
end;procedure TForm1.RadioButton2Click(Sender: TObject);
begin
timer1timer(sender);
end;end.
[错误] Unit1.pas(43): Undeclared identifier: 'timer1timer'
[错误] Unit1.pas(48): Undeclared identifier: 'timer1timer'
[致命错误] Project2.dpr(5): Could not compile used unit 'Unit1.pas'

解决方案 »

  1.   

    要么你注释掉那两行,
    要么你为你的timer1设置ontimer事件处理代码
    在窗体设计器上选择timer1, F11,点开Event,在Ontimer右边的框里双击,然后在代码编辑器里输入代码
      

  2.   

    这个又不是函数,又不是过程timer1timer
    所以报无效的字符串错误再说啦,你的Timer1 控件在这里好像没有什么作用啊,
      

  3.   

    Timer1的Event没有内容。
    你写这个程序到底是为了什么?定时?还是其他?
    定时的话,你设定Timer的Interval属性(毫秒数)。然后你直接控制Timer的Enabled属性。Timer1的Timer事件的意思是完成了消耗要进行的动作。