I want a random timer in pascal, but i have always problem with the number typs.
I'm thinking on a machinke what generates a numer between 10 and 60 seconds. Delay in the background, but if time ends writeln The time has ended. What you think is it possible?

Yes, as a way

procedure OnTimer(Sender: TObject)
begin
  WriteLn('The time has ended');
end;

var
  Timer: TTimer;
  TimerDelay: integer;
begin  
  Randomize;
  TimerDelay = 10 + Random(50);
  Timer := TTimer.Create(self);
  Timer.Interval := TimerDelay;
  Timer.OnTimer := OnTimer;
end;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.