Autor Beitrag
kabizolis
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 86



BeitragVerfasst: Mi 25.05.05 10:03 
Ich erhalte bei meinem Programm aus heiterem Himmel folgende Fehlermeldung:

Fehlermeldung:
(Fatal Error) Unit1.pas( 98 ): Program or unit 'Unit1' recursively uses itself


zu

ausblenden Delphi-Quelltext
1:
2:
3:
implementation

uses Unit1;


woran kann das liegen, denn bei den letzten Ausführungen der Applikation hatt's geklappt....
das einzige, was ich in der Zwischenzeit unternommen habe, sind Kommentare hinzugefügt... ich hab' schon geschaut, ob ich dort einen fehler gemacht habe, konnte keinen fehler finden...

wie kommt diese fehlermeldung zustande?

Moderiert von user profile iconTino: Quote-Tags hinzugefügt.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 25.05.05 10:04 
Merkwürdig???
Naja, du benutzt in Unit1.pas wiederum Unit1, wie soll das klappen?
kabizolis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 86



BeitragVerfasst: Mi 25.05.05 10:14 
naja, ich verstehe nichts mehr!
ich habe diese zeile nicht geschrieben und wenn ich sie weglasse geht auch nichts mehr...

ich werde halt mit dem programm neu beginnen...
danke!


Zuletzt bearbeitet von kabizolis am Mi 25.05.05 10:15, insgesamt 1-mal bearbeitet
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 25.05.05 10:14 
Schick mal die ganze Unit.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 25.05.05 10:18 
user profile iconkabizolis hat folgendes geschrieben:
ich werde halt mit dem programm neu beginnen...

HAAAAALT!!!

So war das nicht gemeint :oops: !

Ich erklärs mal kurz: Du schreibst unter uses hin, aus welchen Units du etwas in deiner Unit verwenden willst. Du nimmst also zum Beispiel das Formular aus Unit2 und schreibst also hin uses Unit2;.
Aber: Wenn du in Unit1 etwas aus dieser Unit verwenden willst, steht das ja schon zur Verfügung. Deshalb musst du nicht extra sagen, dass du etwas aus Unit1 verwenden willst, wenn du in Unit1 bist.

Wenn da also nix mehr geht, wenn du das weglässt, dann muss da eine andere Unit in die uses-Klausel!
Welche, da musst du schon, wie Fabian W. bereits geschrieben hat, deinen ganzen Code, oder zumindest die nach der Löschung der uses-Klausel angezeigte Fehlerstelle und Fehlermeldung posten.
kabizolis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 86



BeitragVerfasst: Mi 25.05.05 10:24 
ich habe das Programm mal hochgeladen....

du erreichst es unter:

web509.kappa.ibone.ch/Sorgenkind.rar

wundere dich nicht ab dem Code... ich bin ein Anfänger!

die Verbindung zur Datenbank und andere Prozeduren stammen nicht von mir!

zusätzlich habe ich die MySQL-Datenbank angehängt...

Vielen Dank für die rasche hilfe!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 25.05.05 10:28 
Ja naja, ich hab hier kein Delphi, kann also nicht versuchen, den Code zu kompilieren, deshalb: Wo kommt welche Fehlermeldung beim Kompilieren?
jojo-sp
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 317

Windows XP Prof, Vista Ultimate & Home Premium, Windows 7
Delphi 7 Enterprise, Delphi 2009
BeitragVerfasst: Mi 25.05.05 11:01 
Kann ich leider auch nicht kompilieren -> Delphi4, aber vom reingucken her, sieht das ganze völlig in Ordnung aus.
Wieso hast du ein Form2 und nicht Form1 als "Mainform"?

_________________
Ist der Ruf erst ruiniert, lebts sich gänzlich ungeniert...
Wilhelm Busch (1832 - 1908)
kabizolis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 86



BeitragVerfasst: Mi 25.05.05 12:43 
das hat den Grund, das ich in einer anderen version die form1 als auswahl meiner datenbanken gemacht hab'.... ich hätte das längst änern können und werde das nun auch tun...

danke für eure hilfe!

ich habe aber entgegen eurer aussage doch die sache neu begonnen und jetzt funktioniert alles bestens...
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 25.05.05 15:29 
Dann vergleich mal den Code. Siehst du den Fehler?