Forum: Programmieren allgemein
by Klaus01,
19. Aug 2006
ein Hoch auf die Mathematik und die Möglichkeit Formeln umzustellen:
pnl_worstcasemin.caption := floattostr(widerstand*(1-prozent/100))+' Ohm';
pnl_worstcasemin.caption := floattostr(widerstand*(1+prozent/100))+' Ohm';
Grüße
Klaus
Forum: Programmieren allgemein
by Klaus01,
19. Aug 2006
pnl_Tolerance.Caption:= format('%g',)+' %';
Versuche es einmal damit, ein Blick in die Hilfe würde auch nicht schaden.
Grüße
Klaus
Forum: Programmieren allgemein
by Klaus01,
19. Aug 2006
if (widerstand)<1000 then
begin
pnl_result.caption := floattostr(widerstand)+' Ohm';
pnl_worstcasemin.caption := floattostr(widerstand-tolerance)+' Ohm'; +++++da ist der Fehler
pnl_worstcasemax.caption := floattostr(widerstand +tolerance)+' Ohm'; ?????falsche klammer
end;
Du hast ja anscheinend eine Klammermanie, soviele unnötige Klammern,...
Forum: Programmieren allgemein
by Klaus01,
19. Aug 2006
if rb_4rings.Checked then
begin ++++++wollte ich umstellen (case) tut dann aber auch dumm
wert := floattostr(((cb_ring1.ItemIndex+1)*10) + cb_ring2.ItemIndex);
if cb_ring3.ItemIndex = 0 then widerstand := floattostr((strtofloat(wert)/100));
if cb_ring3.ItemIndex = 1 then widerstand := floattostr((strtofloat(wert)/10));
if cb_ring3.ItemIndex = 2 then ...
Forum: Programmieren allgemein
by Klaus01,
4. Aug 2006
tolerance := floattostr( (strtofloat(pnl_result.caption)/100)*prozent);
Sollte gehen wenn Prozent ein Integer- oder Floatwert ist und tolerance ein String ist.
Grüße
Klaus