Autor Beitrag
Erzengel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 99

Win 2000, WinXP
Delphi 5 Enterprise
BeitragVerfasst: Mo 22.12.03 15:26 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Button1Click(Sender: TObject);


begin
    HH  := TimeToStr(time);
    MM  := TimeToStr(time);
    SS  := TimeToStr(time);

/////////////////////////////////////////////////////

    HH  := copy(HH, 12);
    MM  := copy(MM, 45);
    SS  := copy(SS, 78);


Label1.Caption := HH + '_' + MM + '_' + SS;


Zusehen sein soll 14_21_59 (Std_Min_Sek)
Angezeit wird aber 14_21:59_59 (Std_Min_Sek)

Kennt sich da jemand aus. In der Delphi Hilfe findet man nichts darüber.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 22.12.03 15:33 
Hallo!

Du solltest dir die Parameternamen der Funktion Copy genauer anschauen. Der zweite Parameter gibt nämlich nicht das Ende des Strings an, den du haben willst, sondern die Länge.

Cu,
Udontknow
Andi1982
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 497

WinXP HE
D6 Enterprise
BeitragVerfasst: Mo 22.12.03 15:36 
Sorry Erzengel,
dann hab ichs in meinem Anderen Posting vorhin doch verwechselt, dann müsste es so gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Button1Click(Sender: TObject); 


begin 
    HH  := TimeToStr(time); 
    MM  := TimeToStr(time); 
    SS  := TimeToStr(time); 

///////////////////////////////////////////////////// 

    HH  := copy(HH, 12); 
    MM  := copy(MM, 42); 
    SS  := copy(SS, 72); 


Label1.Caption := HH + '_' + MM + '_' + SS;


Hoffe jetzt geht es, sorry nochmal!

_________________
Solange die Bombe tickt ist alles in Ordnung, erst wenn sie damit aufhört wird es problematisch...
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mo 22.12.03 15:36 
In der Delphi Hilfe hättest du mal unter COPY guggn müssen...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
tmp  := TimeToStr(time);
/////////////////////////////////////////////////////

HH  := copy(tmp, 12);
MM  := copy(tmp, 42);
SS  := copy(tmp, 72);

Label1.Caption := HH + '_' + MM + '_' + SS;


tmp hab ich gewählt damit immer von der sleben zeit ausgegangen wird...
bei copy is der 3. Wert wie weit kopiert werden soll (also immer 2)

EDIT: Too Late...

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Erzengel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 99

Win 2000, WinXP
Delphi 5 Enterprise
BeitragVerfasst: Mo 22.12.03 15:46 
Kann mir das mal einer erklären???
Ich peil das nicht mir der länge.
und warum muß man immer eine 2 als zweite stelle nehmen.
Ich dachte 1,2,4,5,7,8 --> wären die Zhlen positionen.
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mo 22.12.03 15:48 
Du willst ab der Position 1 zwei Zeichen haben, dann ab zeichen 5 wieder 2 Zeichen und ab Zeichen 7 wieder 2 zeichen...

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Erzengel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 99

Win 2000, WinXP
Delphi 5 Enterprise
BeitragVerfasst: Mo 22.12.03 15:57 
Ahhhhhhhh danke für die Hilfe

Schöne Weihnachten

mfg Erzengel
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mo 22.12.03 16:22 
Danke gleichfalls...

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Mo 22.12.03 17:34 
also Leuts...
ausblenden Delphi-Quelltext
1:
s := FormatDateTime('hh_nn_ss',Time);					

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)