Autor Beitrag
Mr.D3ath
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mi 21.03.07 20:15 
Hi,
Ich ich würde gerne das wenn der user in meinem Programm Minuten ins Edit feld eingibt das delphi sich das in minuten umwandelt und den wert dann verwendet?! Ist das irgendwie möglich?
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 21.03.07 20:17 
Hallo!

Jetzt komm ich nich ganz mit!

Topic sagt Minuten in Sekunden und in der Beschreibung is nix von Sekunden erwähnt..

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 21.03.07 20:21 
Ehm, was rechnest du denn wenn du wissen willst wieviel Sekunden 2 Minuten sind? :gruebel:

Ich geh mal von 2*60 =120 Sec aus...

Multiplizieren geht so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var zahl1,zahl2 : integer;
    ergebnis : integer;
begin
 zahl1:=2;
 zahl2:=10;
 ergebnis := zahl1 * zahl2; {ergebnis = 20}
end;


Wenn z.B. im Feld Edit1 der Minutenwert steht, könntest du z.B. so mit ihm rechnen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
var f : integer;
begin
 f:=(StrToIntDef(edit1.text, 0)*60); {in der Variable f steht dann wieviele Sekunden die eingegebene Minutenzahl sind}
end;


edit: Hab grade ZeitGeists Einwand gelesen. Was willst jetzt? sekunden in Minuten oder Min in Sek?


Zuletzt bearbeitet von Karlson am Mi 21.03.07 20:23, insgesamt 1-mal bearbeitet
evilsoft.de
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

XP
Delphi 7
BeitragVerfasst: Mi 21.03.07 20:22 
ausblenden Delphi-Quelltext
1:
2:
3:
...

Edit1.Text := IntToStr(StrToInt(Edit1.Text) * 60);


Edit: to late :/
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 21.03.07 20:24 
user profile iconevilsoft.de hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
uses
  ...,
  math;

...

Edit1.Text := FloatToStr(StrToFloat(Edit1.Text) / 60);


Edit: to late :/


Kleine Ergänzung: Man braucht keine Math Unit für FloatToStr.
evilsoft.de
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

XP
Delphi 7
BeitragVerfasst: Mi 21.03.07 20:26 
user profile iconKarlson hat folgendes geschrieben:
user profile iconevilsoft.de hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
uses
  ...,
  math;

...

Edit1.Text := FloatToStr(StrToFloat(Edit1.Text) / 60);


Edit: to late :/


Kleine Ergänzung: Man braucht keine Math Unit für FloatToStr.


aber fürs teilen.... habs eh verdreht :)
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 21.03.07 20:27 
Nein, auch fürs teilen nicht.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 21.03.07 20:27 
nicht mal fürs Teilen...

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Mr.D3ath Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mi 21.03.07 20:27 
Hi,
Minuten in Sekunden Sry habe mich verschrieben gehabt oben :)
Mr.D3ath Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mi 21.03.07 20:31 
funktioniert einbandfrei aber eine frage kann ich es auch noch verhindern das der Caption vom Edit feld verändert wird?
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 21.03.07 20:33 
Editfeld? Caption? :gruebel:

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Mr.D3ath Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mi 21.03.07 20:35 
Hi,
Ja sry mein den Text ~.~
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 21.03.07 20:36 
ausblenden Delphi-Quelltext
1:
deinEdit.enabled:= false;					


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.


Zuletzt bearbeitet von ZeitGeist87 am Mi 21.03.07 20:43, insgesamt 1-mal bearbeitet
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 21.03.07 20:37 
Hallo!

Sich Quellcode zusammenzukopieren, ohne ihn wirklich zu verstehen, ist der denkbar schlechteste Einstieg. Schau Dir mal ein paar Grundlagen an, z.B. meinen Crashkurs Delphi. Auch bei www.dsdt.info gibt es eine Tutorial- und Grundlagenecke.

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".