[ franjo_tahi @ 15.12.2008. 23:08 ] @
Može li mi tko ovo objastniti... u čemu je problem? ovo je izdvojen dio složenije procedure, podatke dobivam iz baze. U glavnom, vrijednosti se postave kako sam ovdje napisao, a niti ova porocedura se ne izvrši kako treba. Code: procedure TForm1.Button1Click(Sender: TObject); var fKs, fMater, g: double; begin fKS := 0; fMater := 2.2; G := 10; if (fMater = 1) then begin if G < 120 then fKS := 0.583 else fKS := 70/G; end; if (fMater = 2.1) then begin if G < 100 then fKS := 0.7 else fKS := 70/G; end; if (fMater = 2.2) then begin if G < 80 then fKS := 0.875 else fKS := 70/G; end; if (fMater = 3.1) then begin if G < 80 then fKS := 0.875 else fKS := 70/G; end; if ((fMater >= 3.2) and (fMater <= 4)) then begin if G < 60 then fKS := 1.167 else fKS := 70/G; end; if (fMater = 5) then begin if G < 40 then fKS := 1.75 else fKS := 70/G; end; if (fMater = 6) then begin if G < 20 then fKS := 3.5 else fKS := 70/G; end; ShowMessage(FloatToStr(fKS)); end; zašto ne prepoznaje "if fMater = 2.2" kad je eksplicitno zadana vrijednost? Pratim u debuger-u, varijabli fKS nikada ne dodijeli vrijednost... |