:
.., 45 ; 15 25 ; 11 20 ; 7 11 .
.
,
,
.
:
= () /,
- ,
- ,
- . .
.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
trudoemkost: TEdit;
Label1: TLabel;
Label2: TLabel;
obem: TEdit;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
fond: TEdit;
koef: TEdit;
uvelichenie: TEdit;
Label6: TLabel;
yavka: TEdit;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
Button1: TButton;
procedure N6Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure trudoemkostKeyPress(Sender: TObject; var Key: Char);
procedure obemKeyPress(Sender: TObject; var Key: Char);
procedure fondKeyPress(Sender: TObject; var Key: Char);
procedure koefKeyPress(Sender: TObject; var Key: Char);
procedure uvelichenieKeyPress(Sender: TObject; var Key: Char);
procedure Button1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
private
{ Private declarations }
Function getFloat(Str: String): Real;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.N6Click(Sender: TObject);
begin
Halt;
end;
procedure TForm1.N3Click(Sender: TObject);
begin
trudoemkost.Text:= '3,5';
obem.Text:= '3400';
fond.Text:= '1820';
koef.Text:= '1,03';
uvelichenie.Text:= '15';
yavka.Text:= '';
end;
procedure TForm1.N4Click(Sender: TObject);
begin
trudoemkost.Text:= '';
obem.Text:= '';
fond.Text:= '';
koef.Text:= '';
uvelichenie.Text:= '';
yavka.Text:= '';
end;
|
|
procedure TForm1.N5Click(Sender: TObject);
var chislo1, chislo2: Real;
begin
if ((trudoemkost.Text = '') or (obem.Text = '') or (fond.Text = '') or (koef.Text = '') or (uvelichenie.Text = '')) then
ShowMessage(' ')
else
begin
chislo1:= getFloat(trudoemkost.Text)*getFloat(obem.Text)/(getFloat(fond.Text) * getFloat(koef.Text));
chislo2:= getFloat(trudoemkost.Text)*getFloat(obem.Text) * (getFloat(uvelichenie.Text)/100 + 1)/(getFloat(fond.Text) * getFloat(koef.Text));
if chislo1 = chislo2 then yavka.Text:= ' (' + FloatToStr(round(chislo1)) + ' .)';
if chislo1 > chislo2 then yavka.Text:= ' ' + FloatToStr(round(chislo1)) + ' . ' + FloatToStr(round(chislo2)) + ' . ' + FloatToStr(round(chislo1 - chislo2)) + ' .';
if chislo1 < chislo2 then yavka.Text:= ' ' + FloatToStr(round(chislo1)) + ' . ' + FloatToStr(round(chislo2)) + ' . ' + FloatToStr(round(chislo2 - chislo1)) + ' .';
end;
end;
Function TForm1.getFloat(Str: String): Real;
begin
Result:= 0;
if Length(Str) > 0 then
begin
try
Result:= StrToFloat(Str);
except
Result:= 0;
end;
end;
end;
procedure TForm1.trudoemkostKeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9',#8, #44]) then Key:= #0;
with trudoemkost do
if (Pos(',', Text) > 0) AND (Key = #44) then Key:=#0;
end;
procedure TForm1.obemKeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9',#8, #44]) then Key:= #0;
with obem do
if (Pos(',', Text) > 0) AND (Key = #44) then Key:=#0;
end;
procedure TForm1.fondKeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9',#8, #44]) then Key:= #0;
with fond do
if (Pos(',', Text) > 0) AND (Key = #44) then Key:=#0;
end;
procedure TForm1.koefKeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9',#8, #44]) then Key:= #0;
with koef do
if (Pos(',', Text) > 0) AND (Key = #44) then Key:=#0;
end;
procedure TForm1.uvelichenieKeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9',#8, #44, #45]) then Key:= #0;
with uvelichenie do
begin
if (Pos(',', Text) > 0) AND (Key = #44) then Key:=#0;
if ((Pos('-', Text) > 0) OR (Length(Text) > 0)) AND (Key = #45) then Key:=#0;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
N5Click(Sender);
end;
procedure TForm1.N2Click(Sender: TObject);
begin
Form2.Show;
end;
end.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw;
type
TForm2 = class(TForm)
WebBrowser1: TWebBrowser;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormShow(Sender: TObject);
begin
WebBrowser1.Navigate(extractfilepath(paramstr(0))+'spravka.mht');
end;
end.
-
1.
2.
, .
|
|
. , :
1. .
2. .
3. .
4. .
5. .
6. .
. :
1. .
2. .
3. .
. , , . . .
, , , .
: : : , Delphi, Object Pascal.
Delphi 7.0, , -, .
1. .. : , . .: , 2008. 207c.
2. .. .. . - .: , 2009. 351.
3. .. - (). - .: , 2008. 144 .
4. .. . : , 2005. - 200 .
5. .. . . .: , 2007. 256 .
6. .. Delphi 7 .: , 2005. 58 .
7. ., Delphi 7.0: / . .: , 2008. 520 .
8. . C. Delphi .: , 2008. - 197 .
9. ϻ,2007. 344 .
10. . Delphi 7 2007.
11. .. .
12. .. . .: . , 2004. 230.
13. . . : .: , , 2006. 400.
.