1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64:
| procedure TForm1.TimerAutoVKalenderTimer(Sender: TObject); const FmtStr ='Durchsage ab %d.00 Uhr Block 1';
var i,j,p,h : integer; s : string; Stunde : string; datum : string; EndStunde : string; Pfad : string; begin datum:= FormatDateTime('dd-mm-yy',NOW); Veranstaltungen.Memo1.Clear; Form1.Label1.Caption := Stunde; Pfad := Parameter.Edit1.Text + Datum + '.vak'; iF nOT(fileexists(Pfad)) then begin showmessage(Pfad+' nicht gefunden'); EXIT; end; Parameter.ListBoxVKHeute.items.LoadFromFile(Pfad); Parameter.ListBoxVKHeute.Update; Stunde:= (Copy(Parameter.Edit7.Text,0,2)); h := StrToInt(Stunde); Stunde := Format(FmtStr,[h]); If h=23 then h := -1; h := h+1; EndStunde := Format(FmtStr,[h]); Veranstaltungen.Label1.Caption := EndStunde; Veranstaltungen.Label2.Caption := Stunde; i := 0; while i < Parameter.ListBoxVKHeute.Items.Count do begin p :=POS(Stunde,Parameter.ListBoxVKHeute.Items[i]); if p <> 0 then begin With Parameter.ListBoxVKHeute do begin for j := i+1 to Items.Count - 1 do begin if (Items[j]=EndSTunde) OR (length(Items[j])< length(FmtStr)) And (Pos('Durchsage ab %d.00 Uhr Block 1',Items[j])<>0) then break else begin if Parameter.ListBoxVKHeute.Items[j] <> '' then Veranstaltungen.Memo1.Lines.Add(Parameter.ListBoxVKHeute.Items[j]); end; end; end; Break; end; inc(i); end; Veranstaltungen.Show; TimerAutoVKalender.Enabled:=False; end; |