AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Wie kann ich das rechnen

Ein Thema von Gehstock · begonnen am 2. Aug 2006 · letzter Beitrag vom 19. Aug 2006
 
Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#19

Re: Wie kann ich das rechnen

  Alt 19. Aug 2006, 12:06
Ist es Danke
ging ja alles von ganz alleine auser die toleranz

Delphi-Quellcode:
procedure TForm2.btn_executeClick(Sender: TObject);
var
wert : extended;
widerstand : extended;
tolerance: extended;
prozent: extended;

begin
if rb_4rings.Checked then begin
wert := ((cb_ring1.ItemIndex+1)*10) + cb_ring2.ItemIndex;
widerstand := wert * 0.01 * power(10,cb_ring3.ItemIndex);
 end;

if rb_5rings.Checked then begin
wert := ((cb_ring1.ItemIndex+1)*100) +((cb_ring1.ItemIndex+1)*10) + cb_ring2.ItemIndex;
widerstand := wert * 0.01 * power(10,cb_ring54.ItemIndex);
 end;
begin
if (widerstand)>=1000000 then begin
pnl_result.caption := (floattostr((widerstand)/1000000))+' MOhm';
pnl_worstcasemin.caption := '?';
pnl_worstcasemax.caption := '?';
 end;
if (widerstand)>=1000 then begin
 if (widerstand)<1000000 then begin
pnl_result.caption := (floattostr((widerstand)/1000))+' KOhm';
pnl_worstcasemin.caption := '?';
pnl_worstcasemax.caption := '?';
 end;
  end;
if (widerstand)<1000 then begin
pnl_result.caption := (floattostr((widerstand)/1))+' Ohm';
pnl_worstcasemin.caption := (floattostr((widerstand)/1-(tolerance)))+' Ohm'; +++++da ist der Fehler
pnl_worstcasemax.caption := (floattostr((widerstand)/1+(tolerance)))+' Ohm'; ?????falsche klammer
 end;
tolerance := (widerstand)/100*(prozent);
if rb_5rings.Checked then begin

if cb_ring55.ItemIndex = 0 then begin
pnl_Tolerance.Caption:= '5%';
prozent:=(5);
 end;
if cb_ring55.ItemIndex = 1 then begin
pnl_Tolerance.Caption:= '1%';
prozent:=(1);
 end;
if cb_ring55.ItemIndex = 2 then begin
pnl_Tolerance.Caption:= '2%';
prozent:=(2);
 end;
if cb_ring55.ItemIndex = 3 then begin
pnl_Tolerance.Caption:= '0,5%';
prozent:=(0.5);
 end;
if cb_ring55.ItemIndex = 4 then begin
pnl_Tolerance.Caption:= '0,25%';
prozent:=(0.25);
 end;
if cb_ring55.ItemIndex = 5 then begin
pnl_Tolerance.Caption:= '0,1%';
prozent:=(0.1);
 end;
 end;

if rb_4rings.Checked then begin

if cb_ring4.ItemIndex = 0 then begin
pnl_Tolerance.Caption:= '10%';
prozent:=(10);
 end;
if cb_ring4.ItemIndex = 1 then begin
pnl_Tolerance.Caption:= '5%';
prozent:=(5);
 end;
if cb_ring4.ItemIndex = 2 then begin
pnl_Tolerance.Caption:= '1%';
prozent:=(1);
 end;
if cb_ring4.ItemIndex = 3 then begin
pnl_Tolerance.Caption:= '2%';
prozent:=(2);
 end;
if cb_ring4.ItemIndex = 4 then begin
pnl_Tolerance.Caption:= '0,5%';
prozent:=(0.5);
 end;
if cb_ring4.ItemIndex = 5 then begin
pnl_Tolerance.Caption:= '0,25%';
prozent:=(0.25);
 end;
if cb_ring4.ItemIndex = 6 then begin
pnl_Tolerance.Caption:= '0,1%';
prozent:=(0.1);
end;
 end;
  end;
   end;
Marcel
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz