Fórum [ERRO] Programa IMC, Pressão Arterial, Peso Ideal e Frequência Cardíaca ( DELHPI 7) #417081
19/05/2012
0
rfc:= (Excelente);
_____________________________________________________________________________________________
ERROR: Incompatible types: Real and String
i = idade / fc = frequência cardíaca / rfc = Frequência Cardíaca em Repouso / RadioGroup2 = 0 é Masculino e 1 é Feminino.
PS: Declarei as varáveis certas e já conerti certo tbm.
Aguardo uma resposta, obrigado!
Lucas Gabriel
Curtir tópico
+ 0Posts
19/05/2012
Bruno Leandro
Gostei + 0
19/05/2012
Lucas Gabriel
procedure TForm1.Button1Click(Sender: TObject);
var peso, alt, vlrIMC, pimi, pima, fc,i, rfc: real;
indice: integer;
begin
try
peso := StrToFloat(Edit1.Text);
alt := StrToFloat(Edit2.Text);
vlrIMC := IMC(peso, alt);
indice := faixaIMC(vlrIMC);
pimi:= 18*(alt*alt);
pima:= 25*(alt*alt);
Edit5.Text:= FloatToStr (i);
Edit12.Text:= FloatToStr (fc);
Edit11.Text:= FloatToStr (rfc);
Edit3.Text := formatfloat(##.0,vlrIMC);
//Edit3.Text := FloatToStr(vlrIMC);
Edit9.Text := formatfloat(##.0,pimi);
//Edit9.Text:= FloatToStr (pimi);
Edit10.Text := formatfloat(##.0,pima);
//Edit10.Text:= FloatToStr (pima);
corResultado(indice, Form1);
If ((RadioGroup2.ItemIndex=0) and ((i>=18) and (i<=25)) and ((fc>=49) and (fc<=55))) then
rfc:= (Excelente);
except
end;
end;
end.
Gostei + 0
20/05/2012
Bruno Leandro
rfc:= (Excelente);
neste ponto do codigo esta gerando o erro pois a variavel rfc é do tipo real, ou seja voce pode atribuir valores numericos com casas decimais ou não
rfc pode receber
rfc := 1;
rfc := 2.00;
mas uma mensagem como o que ocorre NÃO é aceito(rfc:= (Excelente)).
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)