Note that this Wiki is a work in progress, items may not be updated or may disappear entirely as the pages are updated.

WeeklySchedule.pal

From SpacialAudio

Jump to: navigation, search

Comments: Do NOT just copy this script into your player and start it. It will NOT work.

There are some things that MUST be in place for this script to work cleanly. 1. 0 songs in Queue. Adjust in the Config, Playlist Rotation Rules. 2. No Ghost Queue. Untick Ghost Queue in Config, Playlist Rotation Rules. 3. You must have SayTime installed in the appropriate directories. If you use it of course. If you don't use it, you will have to comment it out. 4. You must clearly define your Categories. If you change them, change the variables here in the config section. 5. To improve execution time, comment out the WriteLn statements. They are only for checking execution during construction. They only slow down execution otherwise, even worse than it is.

I dont have many Station IDs yet, so I use a generic one, IDA, in places where I don't have appropriate ones. That's in Christian Music, and Electronic Music segments.

You should begin by setting out on paper just where your scheduled shows start and finish. Keep in mind the lag time between execution. I've tried to make it so it doesn't matter - but have probably failed miserably.

Monday: Tuesday: Wednesday: Thursday: Friday.

Sunday Midnight, or actually 30 seconds after Sunday Midnight, (Early Monday Morning) through to 6am, Event 1 Christian Music then 6am through to Midday, Event 2 Country Music then Midday to 6pm, Event 3 Electronic Music then 6pm to 12pm. Event 4 World Music Each Week Day. = 24 hoursx 5 days

Saturday 00:00:30 to 8am Event 5 Dance then 8am to 8pm Event 6 Country then 8pm to 12pm Event 7 Dance

Sunday 00:00:30 to 24:00:00 Event 8 Christian


Your other option of course, is to ignore Events, just have the one event, that goes forever. You maybe only have one Category? and it plays 24x7, in which case this becomes REALLY easy. Just configure Event 1 variables.

You get the picture. In other words, PLAN what you are going to do. Do NOT just copy this script into your player and start it. It will NOT work.

ToDo: Add a bit that writes to the Database so that you can show what schedule is playing on your web pages.

Copyright: Dodgey Brothers. Australia. And if you take that seriously.....

Code by: Robert Chalmers. nospam-robert@chalmers.com.au (Australia)

The Mission of Our Lady of Fatima. http://www.chalmers.com.au

http://www.quantum-radio.net

I can be contacted at nospam-robert@quantum-radio.net. If you need help. (Take off the nospam- bit of course!) Donate to the Mission and be blessed.


PAL.Loop := True;
// User Configurable section. READ THIS CAREFULLY
// ----------- SayTime variables -------
const TimeHeader  : String = 'E:\StationPromo\Times\';
const TimeHours   : String = 'E:\StationPromo\Times\Hours\';
const TimeMinutes : String = 'E:\StationPromo\Times\Minutes\';
const MyGMTZone   : Integer = +10;
var C,N          : Integer;
var fname        : String;
var fnamehh      : String;
var fnamemm      : String;
var ampm         : String;
var hh,mm,ss,ms : Integer;
var Z : Integer;
// ------------ common ----------------
// fade decks
function ActivePlayer:TPlayer; forward;
// Call SayTime
function SayTime:DateTime; forward;
function WaitForETA:DateTime; forward;
var E : DateTime;    // Return the length of the queues. Gets modified
var X : DateTime;    // Contains the EventxEnd time
var UnAdjE : DateTime; // Used by saytime. Not modified. Full queue ETA
// ---------------------- file variables ---------------
// File writing and uploading variables. There is also a part - EventxName - in the EVENT section.
var WebPageFile : string = 'E:\\ArtsAndMinds\samHTMweb\CurrentShow.html';
// --------------------- end of file variables and setup.
// -------------Schedule variables-----
var Count : Integer;  // loop counter
var K : Integer;      // Used for the Queue.Count
// Scheduled Events, 1 through xx
{ ************** EVENT 1 ***************}
{ Christian Music   8 hours             }
var Event1Name     : string = 'Christian Music';
var Event1Start    : string = '00:00:30'; // Really early Weekday Mornings.
var Event1End      : string = '07:59:30'; // untill 8am each week day
var Event1Limit    : string = '08:00:00'; // The do-until limit
{ ************** EVENT 2 ***************}
{ Country Music     4 hours             }
var Event2Name     : string = 'Country Music';
var Event2Start    : string = '07:59:30'; // Weekday from 8am
var Event2End      : string = '11:59:30'; // untill 12 Midday
var Event2Limit    : string = '12:00:00'; // The do-until limit
{ ************** EVENT 3 ***************}
{ World Music       4 hours             }
var Event3Name     : string = 'World Music';
var Event3Start    : string = '11:59:30'; // Midday Weekdays
var Event3End      : string = '19:59:30'; // untill 8pm
var Event3Limit    : string = '20:00:00'; // The do-until limit
{ ************** EVENT 4 ***************}
{ Electronic Music  4 hours             }
var Event4Name     : string = 'Electronic Music';
var Event4Start    : string = '19:59:30'; // 8pm Weekdays
var Event4End      : string = '23:59:45'; // untill Midnight
var Event4Limit    : string = '24:00:00'; // The do-until limit
{ ************** EVENT 5 ***************}
{ Country Music     12 hours            }
var Event5Name     : string = 'Country Music';
var Event5Start    : string = '00:00:15'; // Really early Saturday Morning
var Event5End      : string = '11:59:30'; // untill Midday
var Event5Limit    : string = '12:00:00'; // The do-until limit
{ ************** EVENT 6 ***************}
{ World Music       12 hours            }
var Event6Name     : string = 'World Music';
var Event6Start    : string = '11:59:30'; // Midday Saturday
var Event6End      : string = '23:59:45'; // untill Midnight
var Event6Limit    : string = '00:30:30'; // The do-until limit
{ ************** EVENT 7 ***************}
{ Christian Music   10 hours            }
var Event7Name     : string = 'Christian Music';
var Event7Start    : string = '00:00:15'; // Really Early Sunday Morning
var Event7End      : string = '09:59:30'; // untill 10am Sunday
var Event7Limit    : string = '10:00:00'; // The do-until limit
{ **************************************}
{ ************** EVENT 8 ***************}
{ Christian Music   14 hours            }
var Event8Name     : string = 'Christian Music';
var Event8Start    : string = '09:59:30'; // Sunday Morning
var Event8End      : string = '23:59:45'; // untill Midnight Sunday
var Event8Limit    : string = '00:00:30'; // The do-until limit
{ This event is basically a test.      }
{ **************************************}
// Category name holders. As many as you need.
var CatA : string = 'World';
var CatB : string = 'Country';
var CatC : string = 'Electronic';
var CatD : string = 'Christian';
// Station IDs, suitable for Category beingplayed.
var CatIDA : string = 'WorldIDs';
var CatIDB : string = 'CountryIDs';
var CatIDC : string = 'ElectronicIDs';
var CatIDD : string = 'ChristianIDs';
  { NOTE. }
  { I dont have many Station IDs done yet, so watch out below. I use the
    the same ones a lot. ie; In Christina segments, I still use WorldIDs. }
 // Boolean switches to watch for various days.
var TodayIsMyDayE1 : Boolean;   // E1 = Event1
var TodayIsMyDayE2 : Boolean;   // E2 = Event2 and so on.
var TodayIsMyDayE3 : Boolean;
var TodayIsMyDayE4 : Boolean;
var TodayIsMyDayE5 : Boolean;
var TodayIsMyDayE6 : Boolean;
var TodayIsMyDayE7 : Boolean;
var TodayIsMyDayE8 : Boolean;   // and so on. Depends how many Events you have.
// ----------------------------------------------------------------------------
// End User Configuration Section.
// Do not alter code below this line unless you are confident in what you do!
//Event 1 ----------------------------------------------------------------------
TodayIsMyDayE1 := ((DayOfWeek(Now) = Monday) or
(DayOfWeek(Now) = Tuesday) or
(DayOfWeek(Now) = Wednesday) or
(DayOfWeek(Now) = Thursday) or
(DayOfWeek(Now) = Friday));
while (TodayIsMyDayE1) and (now >= T[Event1Start]) and (now <= T[Event1End])
do
begin 
          WriteLn('Event 1 starts at '+Event1Start);
          WriteLn('Event 1  ends at '+Event1End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
 AppendStringToFile(WebPageFile,Event1Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
          X := T[Event1End];
      Queue.Clear;
       cat[CatIDA].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat [CatD].QueueBottom(smLRP,EnforceRules);
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                DecodeTime(E,hh,mm,ss,ms);
                WriteLn('Next track loads at '+IntToStr(hh)+':'+IntToStr(mm)+':'+IntToStr(ss));
  DecodeTime(now,hh,mm,ss,ms);
  WriteLn('The Time Is '+IntToStr(hh)+':'+IntToStr(mm)+':'+IntToStr(ss));
                WaitForETA;
                PAL.WaitForTime(E);
                    // every 4 tracks put in a station ID and Say The Time.
                    If Count = 4 then
                  begin
                  cat[CatIDA].QueueBottom(smRandom,NoRules);
                  // Call SayTime
                  SayTime;
                  // Sayime code ends here.
                  Count := 0;
                  end;
        until (now >= T[Event1End]);
TodayIsMyDayE1 := False; {Skip loop}
end;
// -----------------------------  End of Event 1 -------------------------------
//Event 2 ----------------------------------------------------------------------
TodayIsMyDayE2 := ((DayOfWeek(Now) = Monday) or
(DayOfWeek(Now) = Tuesday) or
(DayOfWeek(Now) = Wednesday) or
(DayOfWeek(Now) = Thursday) or
(DayOfWeek(Now) = Friday));
while (TodayIsMyDayE2) and (now >= T[Event2Start]) and (now <= T[Event2End])
do
begin
          WriteLn('Event 2 starts at '+Event2Start);
          WriteLn('Event 2  ends at '+Event2End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,Event2Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
          //---------------------
          X := T[Event2End];
       Queue.Clear;
       cat[CatIDB].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat[CatB].QueueBottom(smLRP,EnforceRules);
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                WriteLn('Next track loads at '+TimeToStr(E));
                WaitForETA;
                WriteLn('E is NOW  '+TimeToStr(E));
                PAL.WaitForTime(E);
                    // every 4 tracks put in a station ID and Say The Time.
                    If Count = 4 then
                  begin
                  cat[CatIDB].QueueBottom(smRandom,NoRules);
                  // Call SayTime
                  SayTime;
                  // Sayime code ends here.
                  Count := 0;
                  end;
        until (now >= T[Event2End]);
TodayIsMyDayE2 := False; {Skip loop}
end;
// -----------------------------  End of Event 2 -------------------------------
//Event 3 ----------------------------------------------------------------------
TodayIsMyDayE3 := ((DayOfWeek(Now) = Monday) or
(DayOfWeek(Now) = Tuesday) or
(DayOfWeek(Now) = Wednesday) or
(DayOfWeek(Now) = Thursday) or
(DayOfWeek(Now) = Friday));
while (TodayIsMyDayE3) and (now >= T[Event3Start]) and (now <= T[Event3End])
do
begin
          WriteLn('Event 3 starts at '+Event3Start);
          WriteLn('Event 3  ends at '+Event3End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
    AppendStringToFile(WebPageFile,Event3Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
          X := T[Event3End];
       Queue.Clear;
       cat[CatIDA].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat[CatA].QueueBottom(smLRP,EnforceRules);
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                WriteLn('Next track loads at (E-30s) '+TimeToStr(E));
                   WaitForETA;
                 PAL.WaitForTime(E);
                    // every 4 tracks put in a station ID and Say The Time.
                    If Count = 4 then
                  begin
                  cat[CatIDA].QueueBottom(smRandom,NoRules);
                  // Call SayTime
                  SayTime;
                  // Sayime code ends here.
                  Count := 0;
                  end;
        until (now >= T[Event3End]);
TodayIsMyDayE3 := False; {Skip loop}
end;
// -----------------------------  End of Event 3 -------------------------------
//Event 4 ----------------------------------------------------------------------
TodayIsMyDayE4 := ((DayOfWeek(Now) = Monday) or
(DayOfWeek(Now) = Tuesday) or
(DayOfWeek(Now) = Wednesday) or
(DayOfWeek(Now) = Thursday) or
(DayOfWeek(Now) = Friday));
while (TodayIsMyDayE4) and (now >= T[Event4Start]) and (now <= T[Event4End])
do
begin
          WriteLn('Event 4 starts at '+Event4Start);
          WriteLn('Event 4  ends at '+Event4End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
  AppendStringToFile(WebPageFile,Event4Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
       X := T[Event4End];
       Queue.Clear;
       cat[CatIDA].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat[CatC].QueueBottom(smLRP,EnforceRules);
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                WriteLn('Next track loads at '+TimeToStr(E));
                WaitForETA;
                PAL.WaitForTime(E);
                  If Count = 4 then
                  begin
                  cat[CatIDA].QueueBottom(smRandom,NoRules);
                  SayTime;
                         Count := 0;
                  end;
        until (now >= T[Event4End]);
TodayIsMyDayE4 := False; {Skip loop}
end;
// -----------------------------  End of Event 4 -------------------------------
//Event 5 ----------------------------------------------------------------------
TodayIsMyDayE5 := ((DayOfWeek(Now) = Saturday));
while (TodayIsMyDayE5) and (now >= T[Event5Start]) and (now <= T[Event5End])
 do
 begin
          WriteLn('Event 5 starts at '+Event5Start);
          WriteLn('Event 5  ends at '+Event5End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
    AppendStringToFile(WebPageFile,Event5Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
         X := T[Event5End];
       Queue.Clear;
       cat[CatIDB].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat[CatB].QueueBottom(smLRP,EnforceRules);
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                WriteLn('Next track loads at '+TimeToStr(E));
                WaitForETA;
                PAL.WaitForTime(E);
                    // every 4 tracks put in a station ID and Say The Time.
                    If Count = 4 then
                  begin
                  cat[CatIDB].QueueBottom(smRandom,NoRules);
                  // Call SayTime
                  SayTime;
                  // Sayime code ends here.
                  Count := 0;
                  end;
        until (now >= T[Event5End]);
 TodayIsMyDayE5 := False; {Skip loop}
 end;
// -----------------------------  End of Event 5 -------------------------------
//Event 6 ----------------------------------------------------------------------
TodayIsMyDayE6 := ((DayOfWeek(Now) = Saturday));
while (TodayIsMyDayE6) and (now >= T[Event6Start]) and (now <= T[Event6End])
 do
 begin
          WriteLn('Event 6 starts at '+Event6Start);
          WriteLn('Event 6  ends at '+Event6End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,Event6Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
           X := T[Event6End];
       Queue.Clear;
       cat[CatIDA].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat[CatA].QueueBottom(smLRP,EnforceRules);
                Z := Queue.Duration;
                WriteLn('Queue Duration '+IntToStr(Z));
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                WriteLn('Next track loads at '+TimeToStr(E));
                 WaitForETA;
                PAL.WaitForTime(E);
                    // every 4 tracks put in a station ID and Say The Time.
                    If Count = 4 then
                  begin
                  cat[CatIDA].QueueBottom(smRandom,NoRules);
                  // Call SayTime
                  SayTime;
                  // Sayime code ends here.
                  Count := 0;
                  end;
        until (now >= T[Event6End]) or (now <= T[Event6Limit]);
 TodayIsMyDayE6 := False; {Skip loop}
 end;
// -----------------------------  End of Event 6 -------------------------------
//Event 7 ----------------------------------------------------------------------
TodayIsMyDayE7 := ((DayOfWeek(Now) = Sunday));
while (TodayIsMyDayE7) and (now >= T[Event7Start]) and (now <= T[Event7End])
do
begin
          WriteLn('Event 7 starts at '+Event7Start);
          WriteLn('Event 7  ends at '+Event7End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,Event7Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
       X := T[Event7End];
       Queue.Clear;
       cat[CatIDA].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat[CatD].QueueBottom(smLRP,EnforceRules);
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                WriteLn('Next track loads at '+TimeToStr(E));
                  WaitForETA;
                PAL.WaitForTime(E);
                    // every 4 tracks put in a station ID and Say The Time.
                    If Count = 4 then
                  begin
                  cat[CatIDA].QueueBottom(smRandom,NoRules);
                  // Call SayTime
                  SayTime;
                  // Sayime code ends here.
                  Count := 0;
                  end;
        until (now >= T[Event7End]);
TodayIsMyDayE7 := False; {Skip loop}
end;
// -----------------------------  End of Event 7 -------------------------------
//Event 8 ----------------------------------------------------------------------
TodayIsMyDayE8 := ((DayOfWeek(Now) = Sunday));
while (TodayIsMyDayE8) and (now >= T[Event8Start]) and (now <= T[Event8End])
do
begin
          WriteLn('Event 8 starts at '+Event8Start);
          WriteLn('Event 8  ends at '+Event8End);
// Write the html file header
StrToFile(WebPageFile,'<HTML><HEAD><TITLE>The Current Show</TITLE></HEAD><BODY>'+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,Event8Name+ chr(13)+ chr(10));
   AppendStringToFile(WebPageFile,'</BODY></HTML>'+ chr(13)+ chr(10));
          X := T[Event8End];
       Queue.Clear;
       cat[CatIDA].QueueBottom(smRandom,NoRules);
       ActivePlayer.FadeToNext;
        repeat
          cat[CatD].QueueBottom(smLRP,EnforceRules);
                E := Queue.ETA;
                Count := Count+1;
                E := (E-(30/(60*60*24)));
                WriteLn('Next track loads at '+TimeToStr(E));
                WaitForETA;
                PAL.WaitForTime(E);
                    // every 4 tracks put in a station ID and Say The Time.
                    If Count = 4 then
                  begin
                  cat[CatIDA].QueueBottom(smRandom,NoRules);
                  // Call SayTime
                  SayTime;
                  // Sayime code ends here.
                  Count := 0;
                  end;
        until (now >= T[Event8End]) and (TodayIsMyDayE8);
TodayIsMyDayE8 := False; {Skip loop}
end;
// -----------------------------  End of Event 8 -------------------------------
//---------- Functions --------------------------
function ActivePlayer:TPlayer;
begin
if DeckA.Status = psPlaying then
  Result := DeckA
  else
  Result := DeckB;
end;
//-----------------------------------------------
//-----------------------------------------------
function SayTime:DateTime;
begin
                  //SayTime code begins here.
                  UnAdjE := Queue.ETA;
                  DecodeTime(UnAdjE,hh,mm,ss,ms);
                    if (hh <= 9) then
                      fnamehh := '0'+IntToStr(hh)+'.mp3'   //right file name
                    else
                      fnamehh := IntToStr(hh)+'.mp3';      //right file name
                    if (mm <= 9) then
                      fnamemm := '0'+IntToStr(mm)+'.mp3'   //right file name
                    else
                      fnamemm := IntToStr(mm)+'.mp3';      //right file name
                      fname := 'Header.mp3';
                      WriteLn('SayTime at '+IntToStr(hh)+':'+IntToStr(mm));
                      Queue.AddFile(TimeHeader+fname,ipBottom);
                      Queue.AddFile(TimeHours+fnamehh,ipBottom);
                      Queue.AddFile(TimeMinutes+fnamemm,ipBottom);
                  // Saytime code ends here.
end;
//---------------------------------------------------
function WaitForETA:DateTime;
begin
var duration      : integer;
var dittyDuration : integer;
var hours         : integer;
var minutes       : integer;
var seconds       : integer;
var Emilliseconds  : integer;
var Xmilliseconds  : integer;
var theTimeToWait : string;
  DecodeTime(X,hh,mm,ss,ms);
  WriteLn('The X Event End Time Is '+IntToStr(hh)+':'+IntToStr(mm)+':'+IntToStr(ss));
  WriteLn(hh);
  WriteLn(mm);
  WriteLn(ss);
  WriteLn(ms);
  hours := hh;
  minutes := mm;
  seconds := ss;
       seconds := (hh*60*60);
       seconds := seconds+(mm*60);
       seconds := seconds+ss;
       Xmilliseconds := seconds*1000;
       WriteLn(Xmilliseconds);
  DecodeTime(E,hh,mm,ss,ms);
  //if (hh = 00) then hh := 24;
  WriteLn('The E Queue End Time Is '+IntToStr(hh)+':'+IntToStr(mm)+':'+IntToStr(ss));
  WriteLn(hh);
  WriteLn(mm);
  WriteLn(ss);
  WriteLn(ms);
  hours := hh;
  minutes := mm;
  seconds := ss;
       seconds := (hh*60*60);
       seconds := seconds+(mm*60);
       seconds := seconds+ss;
       Emilliseconds := seconds*1000;
       WriteLn(Emilliseconds);
        // E := Queue.ETA; which is the Actual time the queue ends.
        //  so PAL.WaitForTime(E); waits for a specific time.
        // then if the WaitForTime is actually now after Midnight then hh will be 00.
        // and the Xmilliseconds = 86385000 = 23:59:45. The only time it does. Just on midnight.
        if (hh = 0) and (Xmilliseconds >= 86385000) then
         E := X;
              // PAL.WaitForTime(E)is past the segment end time, so change it to the
              // segment end time.
        // This bit handles all the others ok.
       if  (Emilliseconds > Xmilliseconds) then
         E := X
       else
         WriteLn('Queue is shorter than session.');
        DecodeTime(E,hh,mm,ss,ms);
       WriteLn('E End Time Changed to '+IntToStr(hh)+':'+IntToStr(mm)+':'+IntToStr(ss));
end;
Personal tools