比如时间在XX:50到XX:10分都判断为有效,自动执行一段程序,该怎么写

解决方案 »

  1.   

    加一个TTimer控件, 每30秒判断一次。
      

  2.   

    FormatDateTime('"The meeting is on " dddd, mmmm d, yyyy, " at " hh:mm AM/PM', Now)
    要实现你所说的功能只要用Timer不超过一小时判断一次
    if mytime = now.gethour then ...未经测试,不过思想就是这样,不过不行只要稍作修改就行
      

  3.   

    自己解决了procedure TForm1.Timer1Timer(Sender: TObject);
    var Hour, Min, Sec, MSec: Word;
    begin
      DecodeTime(now, hour, min, Sec, MSec);
      if min < 10 then showmessage('1')
      else showmessage('2');
    end;