Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
Delphi 2007 Professional
|
Re: Problem mit Größer als und Kleiner als
25. Jul 2006, 20:23

Zitat von EDatabaseError:
Was anderes... was machst du wenn der Widerstand genau 1 kOhm ist.
Denn Ohm bei kleiner 1000
kOhm bei größer 1000
[/delphi]
Ups hast recht
Delphi-Quellcode:
procedure TForm2.btn_execute_preresistClick(Sender: TObject);
var
Resistor : string;
begin
Resistor := floattostr(((strtofloat(edit_UV.text)-
strtofloat(edit_UD.text))/strtofloat(edit_ID.text))*1000);
if StrToInt(Resistor)<1000000 then begin
pnl_calculated_resistor.caption := (floattostr((strtofloat(resistor)/
1000000))+' MOhm')
end;
if StrToInt(Resistor)>1000 and StrToInt(Resistor)<1000000 then begin
pnl_calculated_resistor.caption := (floattostr((strtofloat(resistor)/
1000))+' KOhm')
end;
if StrToInt(Resistor)<999 then begin
pnl_calculated_resistor.caption := resistor+' Ohm'
end;
end;
Marcel
|
|
Zitat
|