Autor Beitrag
ASBMorsi2003
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mo 14.04.03 10:34 
Wie bekomme ich eine Variable a, welche die Sekunden beinhaltet in eine Minuten Ausgabe! Dabei dürfen die Sekunden aber nicht größer als 59 sein. Danke
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Mo 14.04.03 10:39 
Hi
Meinst du sowas:
ausblenden Quelltext
1:
2:
3:
4:
 b : string;
 ...
 b := IntToStr( a div 60 ) + ':' + IntToStr( a mod 60 );
 ...


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
ASBMorsi2003 Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mo 14.04.03 11:07 
Klappt irgendwie nicht. "Operator ist auf diesen Operantentyp nicht anwendbar." Gibt es noch andere Möglichkeiten? Danke
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 14.04.03 11:14 
Dann ist a kein integer.

_________________
Gruß
Hansa
ASBMorsi2003 Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mo 14.04.03 11:29 
Kann die Sekunden (a) bloß als real einlesen. Bei integer kommt "Inkopatible Typen".
ASBMorsi2003 Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mo 14.04.03 11:35 
Das liegt daran, wenn ich a auslese kommt sowas: 200,5 sec. Kann mann nicht irgendwie runden, das man a als integer benutzen kann. Tausend dank!!!
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 14.04.03 11:37 
ausblenden Quelltext
1:
format('%.0f',[a]);					


sowas?? :)

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 14.04.03 11:44 
rund (200,51) ergibt : 201
trunc (200,99) ergibt : 200

eines der beiden müßte genügen.

_________________
Gruß
Hansa
ASBMorsi2003 Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mo 14.04.03 13:55 
Danke, jetzt hat's geklappt! Das einzige was noch ist, bei Liedern mit ner Null, z.B. 7:04 zeigt er an: 7:4. Was könnte das sein? Danke!!!
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 14.04.03 14:02 
geh der Antwort von foxy mal nach in der OH

_________________
Gruß
Hansa
ASBMorsi2003 Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mi 16.04.03 13:41 
Was hast du gemeint? Ich komme mit dem Befehl von Foxy nicht klar! Habe weiterhin das Problem mit der Null! Danke für eure Hilfe!!!
So sieht's im Moment aus:
ausblenden Quelltext
1:
2:
c:= (trunc(a));
b := IntToStr( c div 60 ) + ':' + IntToStr( c mod 60 );


:?: :?: :?:
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Mi 16.04.03 14:00 
ASBMorsi2003 hat folgendes geschrieben:
Danke, jetzt hat's geklappt! Das einzige was noch ist, bei Liedern mit ner Null, z.B. 7:04 zeigt er an: 7:4. Was könnte das sein? Danke!!!
Das ist doch genau das selbe. Egal, so sollte es gegen:b := format('%d:%.2d', [Sec div 60, Sec mod 60]);Gruß wulfskin!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.