Set_timer

Internφ programovacφ jazyk

procedure Set_timer(elapse, msg : integer);

Parametry

elapse Φasov² interval v ms
msg Φφslo zprßvy

Od verze:

5.0

Popis

Je-li elapse > 0, spustφ ΦasovaΦ, kter² ka₧d²ch elapse milisekund vyÜle zprßvu msg . Tuto zprßvu lze p°eΦφst funkcφ Get_ext_message. Je-li elapse <= 0, ΦasovaΦ se zastavφ. V jednom okam₧iku m∙₧e b²t v Φinnosti pouze jeden ΦasovaΦ. ╚asovaΦ se automaticky zastavφ takΘ p°i dob∞hnutφ programu.

P°φklad

var
  msg : integer;
  tt : time;
  id : window_id;
  viewdef : string[1000];
begin
  viewdef := '`a` DBDIALOG 227 7 260 171 '
             'HDFTSTYLE 135168 '
             'BACKGROUND 173 '
             'FONT 8 238 34 ""MS Sans Serif"" '
             'BEGIN '
              'CTEXT 3 62 40 108 28 8388609 0 '
              'BACKGROUND 255 '
              'PRECISION 1 '
              'VALUE TT '
              'FONT 10 238 34 ""MS Sans Serif"" BOLD '
              'PUSHBUTTON ""Konec"" 4 64 106 106 24 65536 0 '
              'ACTION RETURN -1 '
             'END ';
  Set_timer(1000,7777);
  tt := Now;
  Open_view(viewdef,NO_REDIR,0,0,0,id);
  while Get_message(msg) do
  begin
    if msg=7777 then begin
      tt := Now;
      Reset_view(id,-1,RESET_CONTROLS);
    end;  
  end;
end.

Viz