The unit Unit1;
Interface
USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, DBTables OleCtnrs, Comobj, WordXP;//add five things
Type
TForm1=class (TForm)
Edit1: TEdit;
For: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button0: TButton;
Button16: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button17: TButton;
Button18: TButton;
Memo1: TMemo;
Button10: TButton;
Button11: TButton;
Button19: TButton;
Button20: TButton;
Button21: TButton;
Button22: TButton;
Procedure FormShow (Sender: TObject);
Procedure Button18Click (Sender: TObject);
Procedure Button0Click (Sender: TObject);
Procedure Button1Click (Sender: TObject);
Procedure Button2Click (Sender: TObject);
Procedure Button3Click (Sender: TObject);
Procedure Button4Click (Sender: TObject);
Procedure Button5Click (Sender: TObject);
Procedure Button6Click (Sender: TObject);
Procedure Button7Click (Sender: TObject);
Procedure Button8Click (Sender: TObject);
Procedure Button9Click (Sender: TObject);
Procedure Button16Click (Sender: TObject);
Procedure Button15Click (Sender: TObject);
Procedure Button14Click (Sender: TObject);
Procedure Button13Click (Sender: TObject);
Procedure Button12Click (Sender: TObject);
Procedure Button21Click (Sender: TObject);
Procedure button17Click (Sender: TObject);
Procedure Button11Click (Sender: TObject);
Procedure Button19Click (Sender: TObject);
Procedure Button20Click (Sender: TObject);
Procedure Button10Click (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
end;
Var
Form1: TForm1;
Implementation
{$R *. DFM}
Procedure TForm1. Button10Click (Sender: TObject);
The begin
If memo1. Text="' then
Memo1. Text:='
The else
Memo1. Text:=memo1. Text + '. '.
end;
Procedure TForm1. Button11Click (Sender: TObject);
The begin
If memo1. Text="' then
='%' memo1. Text:
The else
Memo1. Text:=memo1. Text + '%';
end;
Procedure TForm1. Button12Click (Sender: TObject);
The begin
If memo1. Text="' then
Memo1. Text:='+'
The else
Memo1. Text:=memo1. Text + '+';
end;
Procedure TForm1. Button13Click (Sender: TObject);
The begin
If memo1. Text="' then
Memo1. Text:='-'
The else
Memo1. Text:=memo1. Text + '-';
end;
Procedure TForm1. Button14Click (Sender: TObject);
The begin
If memo1. Text="' then
Memo1. Text:='*'
The else
Memo1. Text:=memo1. Text + '*';
end;
Procedure TForm1. Button15Click (Sender: TObject);
The begin
If memo1. Text="' then
Memo1. Text:='/'
The else
Memo1. Text:=memo1. Text + '/';
end;
Procedure TForm1. Button16Click (Sender: TObject);//equal sign code
Const f='a cosine=Math. A cosine; + '
'the asin=Math. Asin; + '
'the atan=Math. Atan; + '
'atan2=Math. Atan2; + '
'the ceil=Math. Ceil; + '
'cos=Math. Cos; + '
'e=Math. E; + '
'exp=Math. Exp; + '
'floor=Math. The floor; + '
'ln10=Math. Ln10; + '
'the ln2=Math. Ln2; + '
'the log=Math. The log; + '
'log10e=Math. Log10e; + '
'log2e=Math. Log2e; + '
'Max=Math. Max; + '
'min=Math. Min; + '
'PI=Math. PI; + '
=math.h 'pow pow; + '
'the random=Math. The random; + '
'round=Math. Round; + '
'sin=Math. Sin; + '
'SQRT=Math. SQRT; + '
'sqrt2=Math. Sqrt2; + '
'tan=Math. Tan; ';
Var
S, ss: string;
X: double;
Script: OleVariant;
The begin//?? Look not to understand!!!!! The use of Java in computing functions,
S:=lowercase (trim (memo1. Text));//to lowercase letters
Try//invoke JavaScript
Script:=CreateOleObject (' ScriptControl);
Script. Language:='JavaScript';
Script. ExecuteStatement (f + 'STR=' + s);
Ss:=script. Eval (" STR ");
Except,
Ss:='Err;
end;
Edit1. Text:=ss;
end;
Procedure TForm1. Button17Click (Sender: TObject);
The begin
Edit1. Text:=' ';
end;
Procedure TForm1. Button18Click (Sender: TObject);
The begin
Memo1. Text:=' ';
Edit1. Text:=' ';
end;
Procedure TForm1. Button19Click (Sender: TObject);
The begin
If memo1. Text="' then
Memo1. Text:='('
The else
Memo1. Text:=memo1. Text + '(';
end;
Procedure TForm1. Button0Click (Sender: TObject);
The begin
If memo1. Text="' then
='0' memo1. Text:
The else
Memo1. Text:=memo1. Text + '0';
end;
Procedure TForm1. Button1Click (Sender: TObject);
The begin
If memo1. Text="' then
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull