Autor Beitrag
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 10.02.03 16:39 
Hi,
Wie kann ich eine Zahl die in einen Edit eingegeben wird durch die Zahl 56 teilen? PER BUtton klick!
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mo 10.02.03 16:48 
Hallo,

quick and dirty:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
prcedure TForm1.Button1Click(Sender:TObject);
var aZahl:Integer;
begin
  try
    aZahl:=StrToInt(Edit1.Text); // oder StrToFloat für Fließkomma
    ShowMessage('Ergebnis: '+IntToStr(aZahl Div 56));
  except
    on EConvertError do
      ShowMessage('Text '+Edit1.Text+' ist keine Zahl');
  end; // try
end;

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 10.02.03 16:54 
Hi,

@ONLINEHOME: willst du einen Integer oder einen Float durch 56 teilen. Sonst verwendest du eben StrtoFloat. Ergebnis: Int oder Float? Wieder: FloattoStr.

So long,
AXMD