Autor Beitrag
anno2007
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

Win 7, Ubuntu
Delphi XE
BeitragVerfasst: So 22.03.09 03:04 
Hi,
ich stehe gerade wieder übelst auf dem Schlauch :(.

Wie griegt man so etwas zum laufen?

ausblenden Delphi-Quelltext
1:
rect(10/5,10,10,10);					


anno2007
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 22.03.09 05:13 
Ein TRect kann nur ganze Zahlen (Integers) enthalten. Also musst du einen Fließkommawert runden. Dafür bietet sich Round an.
ausblenden Delphi-Quelltext
1:
Rect(Round(DeinFließkommawert), 101010);					
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: So 22.03.09 12:09 
Die Division mittels / liefert immer eine Gleithommazahl. Verwende div, damit du eine Ganzzahldivision durchführst, also 10 div 5

AXMD
anno2007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

Win 7, Ubuntu
Delphi XE
BeitragVerfasst: So 22.03.09 12:36 
Jetzt wo ihrs sagt ist es logisch :D.

Ich habe die Methode mit Round genommen.

Dankeschön :)


anno2007