📄 unitmath.pas
字号:
unit Unitmath;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Edit13: TEdit;
Edit14: TEdit;
Edit15: TEdit;
Edit16: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type Tf=function(var a: double;n:Integer;var det:double):Integer;stdcall; //_bchol@12
//错误声明:type Tf=function(var a:array of double;n:Integer;var det:double):Integer;stdcall;
type THandle=Integer;//int
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
a:array [1..16] of Double;
det:Double;
Handle:THandle;
bchol:Tf;
//s:string;
//i:integer;
begin
a[1]:=StrToFloat(edit1.text);
a[2]:=StrToFloat(edit2.text);
a[3]:=StrToFloat(edit3.text);
a[4]:=StrToFloat(edit4.text);
a[5]:=StrToFloat(edit5.text);
a[6]:=StrToFloat(edit6.text);
a[7]:=StrToFloat(edit7.text);
a[8]:=StrToFloat(edit8.text);
a[9]:=StrToFloat(edit9.text);
a[10]:=StrToFloat(edit10.text);
a[11]:=StrToFloat(edit11.text);
a[12]:=StrToFloat(edit12.text);
a[13]:=StrToFloat(edit13.text);
a[14]:=StrToFloat(edit14.text);
a[15]:=StrToFloat(edit15.text);
a[16]:=StrToFloat(edit16.text);
Handle:=LoadLibrary('MATHLIB52.DLL');
@bchol:=GetProcAddress(Handle,'_bchol@12');
bchol(a[1],4,det);
ShowMessage('行列式的值:' + FloatToStr(det));
FreeLibrary(Handle);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -