| Autor |
Beitrag |
Delphi~Anfänger 
      
Beiträge: 97
|
Verfasst: Mi 02.06.04 14:37
ja schon aber grundlinie a hat damit nichts zu tun (eigentlich) das war es ja auch was mich so verwundert hat

|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mi 02.06.04 14:39
Also: was passiert denn jetzt, wenn Du in Edit7 eine Zahl zu stehen hast und dann auf Button4 klickst? (Zur Laufzeit natürlich)
|
|
Delphi~Anfänger 
      
Beiträge: 97
|
Verfasst: Mi 02.06.04 14:42
Delphi-Quelltext 1: 2: 3: 4: 5: 6:
| procedure TForm1.Button4Click(Sender: TObject); begin n:=strtofloat(edit7.text); e:=(n+1)*n*0.5; label11.caption:=floattostr(e); end; |
also jetzt passiert gar nichts mehr dieser fehler kam nur als ich 'Hallo!' reingeschrieben hab !!!!
Zuletzt bearbeitet von Delphi~Anfänger am Mi 02.06.04 14:43, insgesamt 1-mal bearbeitet
|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mi 02.06.04 14:42
Und: Dein Fehler kommt wohl daher, dass du die Komponenten verwechselt hast. Wenn Grundlinie a damit nix zu tun hat...
|
|
Delphi~Anfänger 
      
Beiträge: 97
|
Verfasst: Mi 02.06.04 14:44
woher weiß ich ob ich die komponenten verwechslt hab (???)

|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mi 02.06.04 14:44
Moment: Wo hast du Hallo reingeschrieben? Ich meinte doch, dass du im Quelltext label11.Caption:='Hallo!' schreiben solltest. Dann steht das in Label11, aber dessen Inhalt wird doch gar nich umgewandelt?
Oder drückst du auf einen anderen Button als Button4, von dem hier die Rede war?
|
|
Delphi~Anfänger 
      
Beiträge: 97
|
Verfasst: Mi 02.06.04 14:45
es wird nur button 4 benutzt !!!
|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mi 02.06.04 14:46
| Zitat: |
woher weiß ich ob ich die komponenten verwechslt hab (???)
|
Na ja, ich meine, dass du vielleicht gar nicht in Edit7 einen Wert reinschreibst, sondern in ein anderes Edit-Feld, dass du für Edit7 hälst.
Und um das rauszufinden, musst Du nur in Delphi draufklicken und nachsehen, was links im Objektinspektor für ein Name steht.
|
|
Delphi~Anfänger 
      
Beiträge: 97
|
Verfasst: Mi 02.06.04 14:48
denkst du das hab ich nich schon lange geprüft (ich hab dieses problem schon ein bischen länger)
|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mi 02.06.04 14:48
Also: Um jetzt den Fehler zu finden:
Schreib mal in das onClick-Ereignis von Button4 folgendes rein:
Delphi-Quelltext 1: 2: 3: 4: 5:
| ShowMessage(edit7.text); n:=strtofloat(edit7.text); ShowMessage(floattostr(n)); e:=(n+1)*n*0.5; ShowMessage(floattostr(e)); |
Es müsste zweimal das angezeigt werden, was du in Edit7 geschrieben hast, und einmal das Ergebnis.
|
|
FaTaLGuiLLoTiNe
      
Beiträge: 200
Erhaltene Danke: 5
Windows 7, Windows 8.1
Delphi XE
|
Verfasst: Mi 02.06.04 14:48
Vielleicht sollte Delphi~Anfänger mal mit dem kompletten Quelltext inkl. Formulardatei um die Ecke kommmen, da das hier langsam zu einer mentalen Schnitzeljagd ausartet ...
_________________ << FaTaLGuiLLoTiNe >>
Rhinoceroses don't play games!
|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mi 02.06.04 14:51
| Zitat: | | Vielleicht sollte Delphi~Anfänger mal mit dem kompletten Quelltext inkl. Formulardatei um die Ecke kommmen, da das hier langsam zu einer mentalen Schnitzeljagd ausartet ... |
Gute Idee! Und an den Text der Formulardatei kommst man so:
Rechte Maustaste auf das Formular und "Als Text anzeigen" auswählen. Das ganze mal bitte hier posten.
(Das sollte vielleicht erwähnt werden)
|
|
Delphi~Anfänger 
      
Beiträge: 97
|
Verfasst: Mi 02.06.04 14:52
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268:
| object Form1: TForm1 Left = 175 Top = 101 Width = 618 Height = 535 Cursor = crCross HorzScrollBar.Position = 136 VertScrollBar.Position = 48 BorderWidth = 5 Caption = 'Rechenprogramm' Color = clMaroon Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False Visible = True PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = -24 Top = 248 Width = 176 Height = 13 Cursor = crNo Caption = 'Volumen ' Color = clRed ParentColor = False end object Label2: TLabel Left = -24 Top = 272 Width = 175 Height = 13 Cursor = crNo Caption = 'Oberfläche ' Color = clRed ParentColor = False end object Label3: TLabel Left = 152 Top = -40 Width = 271 Height = 37 Caption = 'Rechenprogramm' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -32 Font.Name = 'MS Sans Serif' Font.Style = [fsBold, fsUnderline] ParentFont = False end object Label4: TLabel Left = -40 Top = 16 Width = 612 Height = 13 Caption = 'Mit diesem Programm könnt ihr den Flächeninhalt und das Volumen ' + 'von verschiedenen Figuren ausrechnen.' Color = clMaroon Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentColor = False ParentFont = False end object Label5: TLabel Left = -24 Top = 64 Width = 174 Height = 13 Cursor = crHourGlass Caption = 'Quader und Würfel ' Color = clBlack Font.Charset = DEFAULT_CHARSET Font.Color = clRed Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] ParentColor = False ParentFont = False end object Label6: TLabel Left = 184 Top = 64 Width = 174 Height = 13 Cursor = crHourGlass Caption = 'Dreieck 3D ' Color = clBlack Font.Charset = DEFAULT_CHARSET Font.Color = clRed Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] ParentColor = False ParentFont = False end object Label7: TLabel Left = 184 Top = 248 Width = 176 Height = 13 Cursor = crNo Caption = 'Volumen ' Color = clRed ParentColor = False end object Label11: TLabel Left = 376 Top = 248 Width = 145 Height = 13 Cursor = crNo Caption = 'Ergebnis ' Color = clRed Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Serif' Font.Style = [] ParentColor = False ParentFont = False end object Label12: TLabel Left = 376 Top = 64 Width = 151 Height = 13 Cursor = crHourGlass Caption = 'Gaußche Rechnung ' Color = clBlack Font.Charset = ANSI_CHARSET Font.Color = clRed Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] ParentColor = False ParentFont = False end object Button1: TButton Left = -24 Top = 192 Width = 177 Height = 41 Cursor = crHandPoint Caption = 'Rechnen' TabOrder = 3 OnClick = Button1Click end object Edit1: TEdit Left = -24 Top = 96 Width = 177 Height = 21 Color = clGreen TabOrder = 0 Text = 'Länge (l)' OnClick = Edit1Change end object Edit2: TEdit Left = -24 Top = 128 Width = 177 Height = 21 Color = clGreen TabOrder = 1 Text = 'Breite (b)' OnClick = Edit2Change end object Edit3: TEdit Left = -24 Top = 160 Width = 177 Height = 21 Color = clGreen TabOrder = 2 Text = 'Höhe (h)' OnClick = Edit3Change end object Button2: TButton Left = 472 Top = 432 Width = 177 Height = 49 Cursor = crHandPoint Caption = 'Quit' TabOrder = 4 OnClick = Button2Click end object Edit4: TEdit Left = 184 Top = 96 Width = 177 Height = 21 Color = clGreen TabOrder = 5 Text = 'Grundlinie (a)' OnClick = Edit4Change end object Edit5: TEdit Left = 184 Top = 128 Width = 177 Height = 21 Color = clGreen TabOrder = 6 Text = 'Länge (hª)' OnClick = Edit5Change end object Edit6: TEdit Left = 184 Top = 160 Width = 177 Height = 21 Color = clGreen TabOrder = 7 Text = 'Höhe (h)' OnClick = Edit6Change end object Button3: TButton Left = 184 Top = 192 Width = 177 Height = 41 Cursor = crHandPoint Caption = 'Rechnen' TabOrder = 8 OnClick = Button3Click end object Edit7: TEdit Left = 376 Top = 96 Width = 153 Height = 22 Color = clGreen Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Arial' Font.Style = [] ParentFont = False TabOrder = 9 Text = 'Zahl (n)' OnChange = Edit7Change OnClick = Edit7Change end object Button4: TButton Left = 376 Top = 192 Width = 153 Height = 41 Cursor = crHandPoint Caption = 'Rechnen' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False TabOrder = 10 OnClick = Button3Click end end |
|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mi 02.06.04 14:56
Na jetzt ist der Fehler ja klar!!!
Wenn Du auf den Button4 klickst, wird Button3Click ausgeführt:
Delphi-Quelltext 1: 2: 3: 4: 5:
| a:=strtofloat(edit4.text); ha:=strtofloat(edit5.text); hg:=strtofloat(edit6.text); o:=a*ha*0.5*hg; label7.caption:=floattostr(o); |
Und nicht Button4Click...
In dem, was du gerade gepostet hast, musst du nur ganz unten (drittletzte Zeile) hinschreiben:
Delphi-Quelltext 1:
| OnClick = Button4Click |
|
|
Delphi~Anfänger 
      
Beiträge: 97
|
Verfasst: Mi 02.06.04 14:57
oooooooohhhhhhhhhhhhhhhhh neeeeeeeeeeeeee
danke leute (sonnen dummen fehler ahhhhhhhrrrrrrrrrrgggg)
|
|
FaTaLGuiLLoTiNe
      
Beiträge: 200
Erhaltene Danke: 5
Windows 7, Windows 8.1
Delphi XE
|
Verfasst: Mi 02.06.04 15:01
Nach der ganzen wirschen Rumraterei konnte es eigentlich nur noch irgendwas völlig Triviales gewesen sein  .
_________________ << FaTaLGuiLLoTiNe >>
Rhinoceroses don't play games!
|
|