Zahiriddin muhammad bobur nomidagi andijon davlat universiteti


Library MyLibrary; Function



tải về 0.79 Mb.
trang22/27
Chuyển đổi dữ liệu01.03.2024
Kích0.79 Mb.
#56678
1   ...   19   20   21   22   23   24   25   26   27
Zahiriddin muhammad bobur nomidagi andijon davlat universiteti

Library MyLibrary;
Function MyFunc (...):...;
begin
end;
Procedure MyProc;
begin
end;
Exports
MyFunc, MyProc;
begin
end.
Podprogramma nomidan tashqari DLL ga uning tartib nomeri joylashtiriladi: birinchi podprogramma nomeri 0, keyingisi - 1 va xokazo. Dasturchi bu indeksatsiyani o’zgartirishi va 0 dan 32767 gacha nomer qo’yishi mumkin:
Expots
MyFunc index 1, MyProc index 2;
Dasturchi eksport qilinayotgan podprogramma uchun tashqi nom berishi mumkin:
Exports
MyFunc index I name 'NEWFUNC';
CHaqirayotgan dastur eksport qilinayotgan podprogramma tashqi nomi yoki indeksi bo’yicha chaqirishi mumkin.
Misol
Misol tariqasida cmplx modulini kuramiz.
Library Cmplx;
uses
SysUtils, Classes;
{$R *.RES}
type
TComplex = record Re, Im: Real;
end;
function AddC(x, y: TComplex): TComplex; stdcall;
begin
Result.Im := x.Im + y.Im;
Result.Re := x.Re + y.Re end;
function SubC(x, y: TComplex): TComplex;
stdcall;
begin
Result.Im := x.Im - y.Im;
Result.Re := x.Re - y.Re
end;
function MulC(x, u: TComplex): TComplex;
stdcall;
begin
Result.Re := x.Re * y.Re + x.Im * y.Im;
Result.Im := x.Re * y.Im - x.Im * y.Re
end;
function DivC(x, y: TComplex): TComplex;
stdcall;
var
z: Real;
begin
z := sqr(y.Re) + sqr(y.Im);
try
Result.Re := (x.Re * y.Re + x.Im * y.Im)/z;
Result.Im := (x.Re * y.Im - x.Im * y.Re)/z
except
Result.Re := le+309;
Result.Im := le+309

tải về 0.79 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   19   20   21   22   23   24   25   26   27




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương