nigeldude
05-22-2006, 08:32 PM
Hi, I’m trying to create an app that will run in the background when closed and will launch itself at two specified time each weekday and present the user with an audio player with a "listbox playlist" containing one audio for each day. It will flash a message to the user to remind him/her that the audio is to be played, and then it will cue up the correct audio for the current day and wait for the user to click the play button.
Now this app must not just get the date and time and show it to the user, but instead it should be able to compare the current date and time to the ones specified and launch itself at these times.
Now I’m trying to set the part where it compares the current time with the ones specified and tell the menu to launch or not. I’m not really getting it correct, please have a look and tell me what am I doing wrong..
_____________On Timer___________________________________
date = System.GetDate(DATE_FMT_ISO);
day = System.GetDate(DATE_FMT_DAYOFWEEK);
time = System.GetTime(4) ..":".. System.GetTime(3);
if day == 2 or 3 or 4 or 5 or 6 then
playtoday = yes
elseif day == 1 or 7 then
playtoday = no;
end
if time >= 06:15 and <= 06:25 then
playnow = yes;
end
if time >= 09:15 and <= 09:25 then
playnow = yes;
end
if playtoday = yes and playnow = yes then
Application.Restore();
end
Now this app must not just get the date and time and show it to the user, but instead it should be able to compare the current date and time to the ones specified and launch itself at these times.
Now I’m trying to set the part where it compares the current time with the ones specified and tell the menu to launch or not. I’m not really getting it correct, please have a look and tell me what am I doing wrong..
_____________On Timer___________________________________
date = System.GetDate(DATE_FMT_ISO);
day = System.GetDate(DATE_FMT_DAYOFWEEK);
time = System.GetTime(4) ..":".. System.GetTime(3);
if day == 2 or 3 or 4 or 5 or 6 then
playtoday = yes
elseif day == 1 or 7 then
playtoday = no;
end
if time >= 06:15 and <= 06:25 then
playnow = yes;
end
if time >= 09:15 and <= 09:25 then
playnow = yes;
end
if playtoday = yes and playnow = yes then
Application.Restore();
end