Autor Beitrag
theluckyghost
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Mo 10.03.03 16:04 
Hi,
Ich benutze die Funktion findcomponent um mit einem index in einer for-Schleife mehrere Editfelder zu durchlaufen. Solange ich die Funktion in einer Button-Procedure verwende funktioniert sie auch, aber wenn ich sie in einer 'normalen' Procedure verwende bekomme ich die Fehlermeldung: 'Undeclared identifier'. Ich möchte die Funktion benutzen, um am Anfang eines Programs Zahlen in die Editfelder zu schreiben. Kann mir jemand sagen weas ich falsch mache und wie ich findcomponent Funktion auch in anderen Procedures verwenden kann.

Danke Benjamin
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mo 10.03.03 16:10 
Schreibe doch mal deine Quellcode hier herein.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mo 10.03.03 16:12 
Ist nur so eine Idee:
Du musst TForm1. vor die procedure Schreiben und diese dann oben bei private nochmal ohne TForm1. angeben. (TForm1 ist der Typ deiner Hauptform + .)

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mo 10.03.03 16:13 
Hallo

leider hast du keinen Quelltext mit gepostet, könnt mir dein Problem so vorstellen:

du mußt die Form davor schreiben
ausblenden Quelltext
1:
2:
3:
4:
procedure meinenormaleproc;
  begin
    Form1.FindComponent...
  end;


oder die proc mit in den private teil der Form aufnehmen
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  TForm1 = class(TForm)
    ...
  private
    { Private-Deklarationen }
    procedure meineandereProc;
  public
   ...
procedure Tform1.meineandereProc;
  begin
    findcomponent ...
  end;

Mfg Frank

//edit, na super, gleich um 2 antowrten zu langsam :cry: :wink:

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mo 10.03.03 16:19 
Ich war ausnahmsweise mal schneller. :D

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 10.03.03 17:09 
@DerDoc: Was meinst du eigentlich mit "oben im private-Bereich ohne TForm1. angeben"? FindComponent ist doch schliesslich schon in TComponent deklariert & implementiert?

Cu,
Udontknow
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mo 10.03.03 17:45 
Diesen Bereich meine ich:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
type
  TForm1 = class(TForm)
  private
    //hier sollte das stehen
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
theluckyghost Threadstarter
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Mo 10.03.03 18:20 
Titel: quellcode
Das mit dem Quellcode gestaltet sich leider etwas schwierig, weil der auf einem Schulrechner ist und ich dort erst wieder in einer Woche Zugriff habe. Trotzdem danke ich euch für eure hilfe und werde mich vieleicht nächsten Montag nochmal melden

Nochmals danke
Benjamin