Pb de calcul ...

cs_etrix Messages postés 55 Date d'inscription mardi 25 mars 2003 Statut Membre Dernière intervention 30 janvier 2004 - 5 avril 2003 à 20:55
cs_Delphiprog Messages postés 4297 Date d'inscription samedi 19 janvier 2002 Statut Membre Dernière intervention 9 janvier 2013 - 5 avril 2003 à 21:45
salut !
voila j'ai mon calcul:

with Form1 do
C2.Caption:= InttoStr(strToInt(E1.Caption) / strToInt(K2.Caption) - strToInt(k1.Caption) * strToInt(100);

ne marche pas

[Erreur] Unit1.pas(112): Types incompatibles : 'String' et 'Integer'

qqun a une odée de l'erreur ?

merci

3 réponses

cs_Delphiprog Messages postés 4297 Date d'inscription samedi 19 janvier 2002 Statut Membre Dernière intervention 9 janvier 2013 32
5 avril 2003 à 21:15
strToInt(100);
100 est un entier et non une chaine !
May Delphi be with you
0
cs_etrix Messages postés 55 Date d'inscription mardi 25 mars 2003 Statut Membre Dernière intervention 30 janvier 2004
5 avril 2003 à 21:37
arf bah now j'ai fait ca:

C2.Caption:= InttoStr(strToInt(E1.Caption) / strToInt(K2.Caption) - strToInt(k1.Caption) * strToInt(x.Caption);

et now [Erreur] Unit1.pas(112): Aucune version surchargée de 'IntToStr' ne peut être appelée avec ces arguments

keski merde ?
0
cs_Delphiprog Messages postés 4297 Date d'inscription samedi 19 janvier 2002 Statut Membre Dernière intervention 9 janvier 2013 32
5 avril 2003 à 21:45
Attends : 100 est devenu x.Caption ?
S'il s'agit de multiplier l'avant dernier membre par 100, alors :

C2.Caption:= InttoStr(strToInt(E1.Caption) / strToInt(K2.Caption) - strToInt(k1.Caption) * 100);

May Delphi be with you
0
Rejoignez-nous