AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Neusten Termin aus ListView

Ein Thema von Yheeky · begonnen am 27. Jun 2002 · letzter Beitrag vom 28. Jun 2002
 
Yheeky

Registriert seit: 7. Jun 2002
1.339 Beiträge
 
#15
  Alt 28. Jun 2002, 22:46
Also ich habe meine letzte Procedure überarbeitet und nun kam ich zu folgender:

Code:
public
FirstTimeDate, FirstTimeTime : Boolean;
Datum, Zeit : Integer;
Datum1, Datum2, Zeit1, Zeit2 : TDateTime;

.
.
.

procedure TForm1.SucheNeustenTermin;
var I : Integer;
begin
for I := 0 to SmartListView1.Items.Count-1 do
    begin
    Datum1 := EncodeDate(StrToInt(Copy(SmartListView1.Items[I].SubItems[1],7,4)),StrToInt(Copy(SmartListView1.Items[I].SubItems[1],4,2)),StrToInt(Copy(SmartListView1.Items[I].SubItems[1],0,2)));
    Datum2 := EncodeDate(StrToInt(Copy(DateToStr(Date),7,4)),StrToInt(Copy(DateToStr(Date),4,2)),StrToInt(Copy(DateToStr(Date),0,2)));
    Datum := Trunc(Datum1) - Trunc(Datum2);

    if Datum = 0 then
       if SmartListView1.Items.Count = 1 then
       StatusBar2.Caption := SmartListView1.Items[I].SubItems[1] + ' / ' + SmartListView1.Items[I].SubItems[2];

    if Datum > 0 then
        begin
        if FirstTimeDate = True then
        begin
        Datum1 := EncodeDate(StrToInt(Copy(SmartListView1.Items[0].SubItems[1],7,4)),StrToInt(Copy(SmartListView1.Items[0].SubItems[1],4,2)),StrToInt(Copy(SmartListView1.Items[0].SubItems[1],0,2)));
        Datum2 := EncodeDate(StrToInt(Copy(DateToStr(Date),7,4)),StrToInt(Copy(DateToStr(Date),4,2)),StrToInt(Copy(DateToStr(Date),0,2)));
        Datum := Trunc(Datum1) - Trunc(Datum2);
        NeustesDatum := IntToStr(Datum);
        end;

        Datum1 := EncodeDate(StrToInt(Copy(SmartListView1.Items[I].SubItems[1],7,4)),StrToInt(Copy(SmartListView1.Items[I].SubItems[1],4,2)),StrToInt(Copy(SmartListView1.Items[I].SubItems[1],0,2)));
        Datum2 := EncodeDate(StrToInt(Copy(DateToStr(Date),7,4)),StrToInt(Copy(DateToStr(Date),4,2)),StrToInt(Copy(DateToStr(Date),0,2)));
        Datum := Trunc(Datum1) - Trunc(Datum2);

        if SmartListView1.Items.Count = 1 then
        StatusBar2.Caption := SmartListView1.Items[I].SubItems[1] + ' / ' + SmartListView1.Items[I].SubItems[2];

        if Datum < StrToInt(NeustesDatum) then
           begin
           StatusBar2.Caption := SmartListView1.Items[I].SubItems[1] + ' / ' + SmartListView1.Items[I].SubItems[2];
           NeustesDatum := IntToStr(Datum);
           FirstTimeDate := False;
           end;

        end;

    end;

end;
Hier muss ich jetzt noch die zum nächsten Termin zugehörige Uhrzeit auslesen. Könnte mir dazu jemand Tipps geben? Wie könnte ich das machen?
Die EncodeTime Funktion funktionierte komischerweise nicht so, wie ich mir das vorgestellt habe, obwohl ich sie wie die Funktion EncodeDate angewendet habe. Als Ergebnis bekomme ich immer 0.

Gruß Yheeky
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:28 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz