Hello,
I want to make a clock. One problem. I don't know how to start
I want something that works like what's in the title. It waits a certain amount of time, and preforms a command.
Please help,
Mike.
Hello,
I want to make a clock. One problem. I don't know how to start
I want something that works like what's in the title. It waits a certain amount of time, and preforms a command.
Please help,
Mike.
Well, you can't do it how you had it, because "Wait" doesn't return a boolean. Try this.
SCAR Code:program Timing;
var
Time: Integer;
begin
repeat
Time:=Time+25;
Wait(1);
if (Time>=1000) then
WriteLn('Yes!');
until(false);
end.
Showing how much time has passed is a stopwatch. For that you can use wait. Wait does not return anything, it just makes the script do nothing for that many milliseconds.
SCAR Code:program New;
{.include SRL/SRL.scar}
var NumberOfSecondsPassed:integer;
begin
SetupSRL;
repeat
wait(1000);
NumberOfSecondsPassed:= NumberOfSecondsPassed+1;
cleardebug;
Writeln(inttostr(NumberOfSecondsPassed)+' seconds have passed');
until isfkeydown(12);
end.
For a clock, you can get the time from the computer and display it how you want. Someone posted an analog clock scripts, prolly in other scripts.
and this could be just a simple clock i made, when i saw this threed:
SCAR Code:program SimpleClock;
var
secondes,minutes,hours: integer;
begin
cleardebug;
repeat
writeln('Clock:');
if(secondes>=60) then
begin
secondes:=0
end;
if(minutes>=60) then
begin
minutes:=0
end;
writeln(inttostr(hours)+' hours '+inttostr(minutes)+' minutes '+inttostr(secondes)+' secundes ');
wait(1000);
if(secondes=59) then
begin
minutes:=minutes+1
end;
if(minutes=59) then
begin
hours:=hours+1
end;
secondes:=secondes+1
cleardebug;
until(isfkeydown(12))
end.
end.
There are currently 1 users browsing this thread. (0 members and 1 guests)