unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ActnList;
type
TForm1 =
class(TForm)
LOHM: TLabel;
EOHM1: TEdit;
Label2: TLabel;
EWATT1: TEdit;
EVOLT1: TEdit;
START1: TButton;
EAMPER1: TEdit;
LSTROM1: TLabel;
LSPANNUNG1: TLabel;
procedure START1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.START1Click(Sender: TObject);
Var AOHM1,AWATT1,U1,I1,ohmges,wattges,uges,iges:real;
Var Watttest1,Ohmtest1,Utest1,Itest1:real;
begin
try
AOHM1:=strtofloat(EOHM1.Text);
except on EConvertError
do
begin
AOHM1:=0;
end;
end;
try
AWATT1:=strtofloat(EWATT1.Text);
except on EConvertError
do
begin
AWATT1:=0;
end;
end;
try
U1:=strtofloat(EVOLT1.Text);
except on EConvertError
do
begin
U1:=0
end;
end;
try
I1:=strtofloat(EAMPER1.Text);
except on EConvertError
do
begin
I1:=0;
end;
end;
//Eingabe
//Prüfen
If AOHM1<>0
then
IF AWATT1<>0
then
uges:=sqrt(AOHM1*AWATT1);
iges:=sqrt(AOHM1/AWATT1);
IF U1<>0
then
wattges:=(U1*U1)/AOHM1;
iges:=sqrt(AOHM1/AWATT1);
IF I1<>0
then
wattges:=(I1*I1)*AOHM1;
uges:=sqrt(AOHM1*AWATT1);
//Ausgabe
EVOLT1.Text:=floattostr(uges);
EAMPER1.Text:=floattostr(iges);
end;
end.