A small While loop who will execute once the day of year (atmidnight) changes
runtime_limit is a small fail_save to abord the loop.
Names Default To Here( 1 );
stop_command = 0;
try(win1<<close window;);
win1 = New Window( "Timer",
V List Box(
tb1 = text box("Date: " || Format( Today(), "d.m.y h:m:s" )),
Button Box( "Cancel",
stop_command =1;
win1 << close window;
)
)
);
i = 1;
runtime_limit = 10; // max number of iterations of the loop
D_year = day of year(today());
while(!stop_command,
i++;
if(i>runtime_limit,stop_command = 1;beep();throw("runtime limit reached"));
wait(1); // execute every X secconds
if(D_year != day of year(today()),
// Execute Code
print(i);
);
D_year = day of year(today());
tb1 << set text("Date: " || Format( Today(), "d.m.y h:m:s" ));
);
"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS