Autor Beitrag
fo3tus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Fr 25.05.07 09:22 
hi all

ich hab das Problem das beim Ablauf meines Programms ein EConvertError auftritt und daas Programm zum stehen kommt...
dachte ich fange dies ab mit try.. except.
möchte der Variable dann wenigstens 'ERROR' als Wert geben..hab ich so gelöst:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
try
.
.
.
except
on EConvertError do RunTime:='ERROR';
end;


leider kommt mein Programm immernoch zum Stillstand...es sollte aber trotzdem weiterlaufen...!? :?
kann mir wer helfen?

danke im voraus
lg
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 25.05.07 09:59 
Moin und :welcome: im Forum!

Du kannst statt StrToInt/Float auch StrToIntDef(Str,Vorgabe) bzw. StrToIntFloat(Str,Vorgabe) verwenden, dann wird ein Standardwert (-> Vorgabe) verwendet, wenn die Zeichenkette sich nicht umwandeln lässt. :idea:

Ansonsten ist der Ansatz mit try-except schon OK, die IDE zeigt aber - wenn du es nicht explizit in den Umgebungsoptionen ausschaltest - trotzdem Exceptions an. Wenn du das Programm direkt (also ohne die IDE) startest, dann wird keine Exception mehr ausgelöst. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
fo3tus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Fr 25.05.07 10:01 
hm, dank dir.
lg
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Fr 25.05.07 10:47 
Wenns nur im Debugger stopt, dann ist das eine reine Einstellungssache seitens der IDE.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 25.05.07 10:49 
Gibts hier ein Echo? :?!?:

user profile iconNarses hat folgendes geschrieben:
...die IDE zeigt aber - wenn du es nicht explizit in den Umgebungsoptionen ausschaltest - trotzdem Exceptions an...

_________________
There are 10 types of people - those who understand binary and those who don´t.
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Fr 25.05.07 11:02 
Es könnte auch ne Einstellungssache der IDE sein ...





















:rofl: :P

_________________
<(^^<) <(^^)> (>^^)>
===================
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Fr 25.05.07 12:27 
:oops: Sorry, hab irgendwie nicht den ganzen Beitrag gelesen