|
Exports
MyFunc, MyProc;
begin
end
|
bet | 8/11 | Sana | 18.01.2023 | Hajmi | 124.7 Kb. | | #38551 |
Bog'liq 1 Protsedura va funktsiyalarni ishlab chiqish va ulardan foydalanish. Ma`ruza mashg`uloti mavzusi pedagogik fik-r tarixi va maktab ama (1), Jamiyat taraqiyotida tarixning mazmuni yo’nalishlari va konsepsiyalariExports
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
end
end;
Exports
|
| |