Divie by Zero lazarus / 21-General ---------------------------------------------------------------------- USchoch · 2024-11-06 15:40 Hallo Ich habe eine Anwendung geschrieben, die ein Stammbaum erzeugt. Beim Erstellen der Grafik kommt oft eine Fehlermeldung "Divide bei Zero". Im Code der Erstellung der Grafik hat es weder "DIV irgendwas" noch "/irgendwas", nur "Div 2". Trotzdem kommt die Fehlermeldung. Warum wohl? Wie kann ich feststellen, wo im Sourcecode sie auftritt? Ich wäre froh um Hinweise Uli ---------------------------------------------------------------------- Thaddy · 2024-11-06 16:49 Dass bekomt du eigentichlich nur mit demm debugger. Leider gebst du nicht besonders viel information. (Sorry about my German, it has become poor..) ---------------------------------------------------------------------- Bart · 2024-11-06 17:05 Compile our code with -gl, this will give you the line numbers where the div by zero happens. If you're using Lazarus the it somewhere in Compiler Options: Menu-> Project->Project Options->Compiler Options->Debugging Check: Display line numbers in runtime-error backtraces. Bart ---------------------------------------------------------------------- USchoch · 2024-11-07 13:03 Hallo Bart Compile our code with -gl,Display line numbers in runtime-error backtraces. Ist schon so eingestellt Siehst du noch weitere Möglichkeiten? Gruss Uli ---------------------------------------------------------------------- MathMan · 2024-11-07 18:57 @USchoch Did you try to run your program from within the Lazarus IDE? When compiled with debug info the IDE should directly show you the offending line where the 'division by 0' happened. German translation: Hast Du schon versucht das Program aus der Lazarus Entwicklungsumgebung (IDE) laufen zu lassen. Normalerweise solltest Du dann direkt angezeigt bekommen an welcher Stelle die Division durch 0 auftritt - zumindest wenn Du mit Debug-Infos kompilierst. MathMan ---------------------------------------------------------------------- PascalDragon · 2024-11-07 20:21 Quote from: USchoch on November 06, 2024, 04:40:29 pmIch habe eine Anwendung geschrieben, die ein Stammbaum erzeugt. Beim Erstellen der Grafik kommt oft eine Fehlermeldung "Divide bei Zero". Im Code der Erstellung der Grafik hat es weder "DIV irgendwas" noch "/irgendwas", nur "Div 2". Trotzdem kommt die Fehlermeldung. Warum wohl? Wie kann ich feststellen, wo im Sourcecode sie auftritt? Ich wäre froh um Hinweise Bitte schreib im internationalen Forum nur auf Englisch oder füge auch noch zusätzlich eine Übersetzung hinzu (die auch maschinell erfolgt sein kann). Wenn du rein auf deutsch bleiben möchtest, dann nimm doch bitte das deutschsprachige Forum. ---------------------------------------------------------------------- MathMan · 2024-11-08 08:37 @PascalDragon Sorry for the omission on my side - I corrected my reply. ---------------------------------------------------------------------- USchoch · 2024-11-09 15:26 Hello The “Divide by Zero” error no longer occurs in my application. I suspect that to display data on a form, e.g. a TLabet, the left or top values were completely wrong, e.g. -16777216, and that this then triggered the error somewhere. Problem fixed. Uli