Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Compilerprobleme bei Inkompatiblen Typen (https://www.delphipraxis.net/96370-compilerprobleme-bei-inkompatiblen-typen.html)

Lill Jens 23. Jul 2007 10:42


Compilerprobleme bei Inkompatiblen Typen
 
Hey Ihr!

Folgendes:

Delphi-Quellcode:
 Label72.Caption:= StrToFloat (Label72.Caption) - i;

Fehlermeldung:

Delphi-Quellcode:
 [Fehler] u_Verwaltung.pas(5437): Inkompatible Typen: 'String' und 'Extended'
Wieso denn? 'i' ist als Integer festgelegt und in 'Label72' speichere ich auch eine Zahl was ist da denn bitte 'Extended'???


Ändere ich das Ganze so:

Delphi-Quellcode:
Label72.Caption:= Label72.Caption - FloatToStr (i);
bekomm ich den Fehler:

Delphi-Quellcode:
[Fehler] u_Verwaltung.pas(5437): Operator ist auf diesen Operandentyp nicht anwendbar




Thx 4 Cmts


Lill Jens :coder2:

DeddyH 23. Jul 2007 10:43

Re: Compilerprobleme bei Inkompatiblen Typen
 
Delphi-Quellcode:
Label72.Caption:= FloatToStr(StrToFloat(Label72.Caption) - i);

Lill Jens 23. Jul 2007 10:45

Re: Compilerprobleme bei Inkompatiblen Typen
 
Zitat:

Zitat von DeddyH
Delphi-Quellcode:
Label72.Caption:= FloatToStr(StrToFloat(Label72.Caption) - i);


Wunderbar dankeschön :thumb:


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:46 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz