Autor Beitrag
wunsiedler
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 506
Erhaltene Danke: 4

Win7

BeitragVerfasst: Mi 03.09.03 15:04 
Wie kann ich prüfen, ob in "Edit1.Text" eine gültige Zahl steht, bevor ich diese mit " StrToFloat" umwandle. Steht da eine ungültige, kommt eine eceptions, was ich vermeiden will.
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Mi 03.09.03 15:13 
Hi,

du kannst verhindern, dass man im Edit etwas anderes als Zahlen eingeben kann. Ein Beispiel hierzu gibt es bei den FAQ's.

MFG

- Ernesto -
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mi 03.09.03 19:25 
StrToFloatDef gibt einen Standard-Wert zurück, wenn der übergebene Wert keine umwandelbare Zeichenfolge darstellt. Vielleicht hilft Dir das.
Wolff68
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 302
Erhaltene Danke: 1

WinXP home
D6 Prof
BeitragVerfasst: Do 04.09.03 17:47 
Oder die exception mittels try... except abfangen.
Dann kannst auch entsprechend auf die falsche Eingabe reagieren (Meldug ausgeben; Berechnung stoppen,...)

Übrigends: Bitte jede Frage nur 1x posten. Unter Delphi-Language hast doch genau das gleiche grfragt, oder nicht ?

_________________
"Der Mensch ist nicht was er sich vorstellt oder wünscht zu sein, sondern das was andere in ihm sehen."
wunsiedler Threadstarter
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 506
Erhaltene Danke: 4

Win7

BeitragVerfasst: Do 04.09.03 19:00 
Ja, weis ich. Hab das Problem jetzt mit try.... gelöst und funktioniert, also nicht mehr antworten hier.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 04.09.03 22:17 
Und damit die schlechteste aller Lösungen gewählt.
w3seek
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 64

Win XP; Win 2k; Suse 9.0
D5 Std, D6 Personal
BeitragVerfasst: Do 04.09.03 22:19 
@wunsiedler
Ich wohne in Wunsiedel :lol:

_________________
OS: WinXP, 2000, Debian
Software: MingW, Delphi 5 Standard, Delphi 6 Personal, FreePascal
wunsiedler Threadstarter
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 506
Erhaltene Danke: 4

Win7

BeitragVerfasst: Fr 05.09.03 16:19 
@w3seek: ich auch.