• Expots
  • Misol tariqasida cmplx modulini kuramiz. Library Cmplx; uses SysUtils, Classes; {$R *.RES} type
  • Result.Re := x.Re + y.Re end; function SubC(x, y: TComplex): TComplex; stdcall; begin
  • Result.Re := le+309; Result.Im := le+309 end end; Exports
  • Exports MyFunc, MyProc; begin end




    Download 124.7 Kb.
    bet8/11
    Sana18.01.2023
    Hajmi124.7 Kb.
    #38551
    1   2   3   4   5   6   7   8   9   10   11
    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 konsepsiyalari
    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

    end


    end;

    Exports



    Download 124.7 Kb.
    1   2   3   4   5   6   7   8   9   10   11




    Download 124.7 Kb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Exports MyFunc, MyProc; begin end

    Download 124.7 Kb.