Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Di 07.10.03 14:31 
Hi Leute !
Ich habe da mal eine Frage :
Ich habe ein Memo-Feld mit vielen URL-Adressen (z.b.www.google.de)
um zu überprüfen,ob man sich mit der jeweiligen URL-Adresse verbinden kann !
Wenn ich mich jetzt mit einer URL-Adresse verbinde und aus irgendwelchen Gründen,ich das nicht kann,sei es "Host nicht gefunden" oder andere Fehlermeldungen,gibt es dann eine Möglichkeit,das man DIESE Fehlermeldung "umgeht/ignoriert" ???
...damit ich die nächste URL-Adresse in der Liste überprüfe !
Also,das Programm soll so tun,als ob nichs geschehen wäre !

Jagg !
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 07.10.03 15:37 
pack das ganze in einen Try..Except block.
z.b.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
try
  // tue irgentwas was vielleicht nicht funktionieren wird
except
  // hier tue was, wenn ein Fehlerauftaucht
end;

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Di 07.10.03 15:45 
tja,das ganze ist ja schon gut aber das problem ist ich weiss nicht welche fehlermeldung immer kommt
oder ist bei try...except das nicht abhängig ???

soll ich schreiben :
try
//url listen laden
ecxept
//bis eine fehlermeldung kommt
kannst du mir vllt mal so ein BSp geben
ich habe noch nie mit try...except gearbeitet

Jagg !
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 07.10.03 15:53 
sofern du im Except block nichts tust, passiert auch nichts, sprich NIX FEHLERMELDUNG !!

nochmal en Beispiel:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure Test;
var 
  I:Integer;
begin
  try
    I:= StrToInt('Test'); // garantiert ein Fehler
  except
    I:=0// keine Fehlermeldung, aber I bei Fehler auf Zero setzen
  end;   
end;


oder

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure Test;
var 
  I:Integer;
begin
  try
    I:= StrToInt('Test'); // garantiert ein Fehler
  except
    MessageDlg('Ups, keine Zahl gefunden!',mtError,[mbOK],0); //Fehlermeldung ausgeben
    I:=0// keine Fehlermeldung, aber I bei Fehler auf Zero setzen
  end;   
end;

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Mi 15.10.03 16:02 
Hi !

Das mit der Fehlermeldung umgehen klappt immer noch nicht !

Code :
ausblenden Quelltext
1:
2:
  NMHTTP1.Get(ed_website.text); 
  REdit_Q.Lines.Text := NMHTTP1.Body;


ed_website.text := www.google.de/help.html;

probiert es mal aus,er sagt immer "Zugriffsverletzung" !
Was mache ich falsch ???

Jagg !
[/code]
blackbirdXXX

ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1077
Erhaltene Danke: 1

Ubuntu Dapper

BeitragVerfasst: Mi 15.10.03 16:53 
Du musst in den Umgebungsoptionen "Bei Exceptions anhalten." deaktivieren. Dann gehts

_________________
Klein, schwarz und ärgert Techniker? Jumper!
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Mi 15.10.03 16:58 
da ist aber nix mit "exceptions anhalten"
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mi 15.10.03 18:27 
hallo jagg!

schau mal unter [tools] - [debugger-optionen] - tabsheet 'sprach-exceptions' nach. dort findest ganz oben die checkbox 'bei delphi exceptions stoppen'.
diese deaktivierst du und schon läuft der debugger drüber

mfg, stefan
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Mi 15.10.03 21:01 
ja,das habe ich jetzt gemacht,danke,aber wenn ich jetzt diese adresse eingebe sagt er mir connection reset by peer,kann man das auch umgehen ???

Jagg !