Autor Beitrag
cyberbug
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 53

WIN XP

BeitragVerfasst: Di 22.01.08 16:42 
Mein problem ist folgendes:

Folgender Quellcodeausschnitt erzeugt bei mir folgende fehlermeldung: Undefinierter Bezeichner: 'OpenDialog1'.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
//...
procedure Button1Click(Sender: TObject);
 begin
if OpenDialog1.Execute then
  begin
    
     //Anweisungen

  end;
end;
//...

Ein Freund von mir meinte, dass das daran läge, dass ich kein OpenDialog1 hätte. Ich habe aber einen. Im Formulardesigner habe ich diese Komponente. Und ausserdem steht im Quellcode auch:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
//...
type
  TForm1 = class(TForm)
  OpenDialog1: TOpenDialog;
//...


Es wäre sehr nett, wenn ihr mir helfen würdet, zumal ich hier im Forum noch kein entsprechendes Thema gefunden habe. Danke im Vorraus
MFG cyberbug
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Di 22.01.08 16:49 
Hallo und :welcome: im Forum!

Ich kann mir vorstellen, dass du deine Komponente ausversehen umbenannt hast!
Wenn deine Komponente unter "Name" etwas anderes stehen hat, kommt der Fehler.
Was anderes fällt mir auf anhieb nicht ein! Sry!

Liebe Grüße

_________________
<(^^<) <(^^)> (>^^)>
===================
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 22.01.08 16:50 
Das liegt daran, dass diese Prozedur nicht zu dem Formular gehört, auf dem der OpenDialog liegt.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Di 22.01.08 16:59 
OMG,
wenn man ein Brett vorm Kopf hat dann aber richtig -.-


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
//...  
procedure TForm1.Button1Click(Sender: TObject);  
 begin  
if OpenDialog1.Execute then  
  begin  
      
     //Anweisungen  
 
  end;  
end;  
//...


.... So meint Jakob das :roll:

Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt

_________________
<(^^<) <(^^)> (>^^)>
===================
cyberbug Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 53

WIN XP

BeitragVerfasst: Di 22.01.08 17:00 
EDIT:: Vielen, vielen Dank für die schnellen Antworten, ja da hab ich wohl ein Brett vor dem Kopf gehabt. :D
IHR HABT MIR SEEEEHR GEHOLFEN!!

MFG cyberbug
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Di 22.01.08 19:14 
Eins würde mich aber trotzdem interessieren: Wie kommt es, dass da kein TForm1. steht? Hast du da manuell gelöscht, aber nicht mehr drangedacht, als der Fehler auftrat? Oder ist das automatisch passiert? Delphi macht das doch normalerweiße richtig :roll:
cyberbug Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 53

WIN XP

BeitragVerfasst: Di 22.01.08 21:15 
ich hab mich, als ich gehört habe was der fehler war, auch gewundert wie das passieren konnte. Und ehrlich gesagt, weiß ich gar nicht wie das wegkam :oops: