WWW.DISSERS.RU


...
    !

Pages:     | 1 |   ...   | 17 | 18 || 20 | 21 |

o ye cyae, ec ao-o .OBJ ao oaec coa pae, e a.ASM, o oopx o ac o a, o cooecy a c pacpee.ASM oe peaccepoa. Turbo Pascal e oe accepoa ae a. o e ea Heoxoo coa oa a Make, a yy Make, oa e o oa a. o a coco acoce oa. acoc opee acoc ao py o pya. oa yaa Make, a coa a a pyx ao.

Co a e o a o o a a M a k e a Make o cyae oe e:

GETSTARS.EXE : GETSTARS.PAS STARDEFS.PAS STARLIB.PAS SLIB1.ASM\SLIB2.ASM SLIB.OBJ SLIB2.OBJ TPC GETSTARS /M SLIB1.OBJ : SLIB1.ASM TASM SLIB1.ASM SLIB1.OBJ SLIB2.OBJ : SLIB2.ASM TASM SLIB2.ASM SLIB2.OBJ epe e cpo oc Make, o GETSTARS.EXE ac o pex ao acax a Turbo Pascal;

yx ao, acax a acceepe; yx.OBJ ao. Opa c (\) oe epo cpo co cpo pooe, .e. cpoa oepaopa pooaec aee.

Tpe cpoa yaae Make, a coaec oa epc GETSTARS.EXE. ae, o opao GETSTARS.PAS coyec oop oao cpo coye cpoeoe Turbo Pascal cpeco Make (apaep /M).

Ceye e cpo (yce cpo oppyc) oop o o, o SLIB1.OBJ ac o SLIB1.ASM o o, a oy SLIB1.OBJ.

ocee e cpo opee acoc ( ooo aa) ece Make SLIB.OBJ.

cooae Make oyc, coa o oa a p oo cpoeoo eppoay cpey peaopa ( e a-o py peaopo), aca coxpae ae STARS.MAK. Eo oo aa oao:

make f STARS.MAK e f o, yaaa Make, ao a cooa. Make opaaae o a c oa o ep aa. Bo-epx, oa poepe a SLIB2.OBJ SLIB2.ASM, ec SLIB2.OBJ capee, o Make ae oay:

TAMS SLIB2.ASM SLIB2.OBJ, oopa accepye SLIB2.ASM coae oy epc SLIB2.OBJ. Tae e ec (poepa a accepoae) pooc c SLIB1.OBJ. B aee, poepc ce acoc GETSTARS.EXE , ec eoxoo, oec oaa:

tpc GETSTARS/M.

O /M yaae Turbo Pascal cooa ype popay Make, oopa pocop ce c, a epeo aa STARLIB.PAS, ec aa coa SLIB1.OBJ SLIB2.OBJ oaec oee oo, e aa coa STARLIB.TPU.

O a o a p o p a Heoope o oopa oaa e, a a paep, a a copoc oe popa.

pocxo o ooy, o acoc o x o popay caec o poep oo x opao. o ye cooa p papaoe popa. B ooaeo epc x peoeyec ca (yeaec paep copaaec pe oe). He pee cco o x ae, oope coyc oa popa.

{$A+} ooe paa epeee poae oca a pay coa. o oeceae oee cp ocy a cce 80 86. o yoa a o ea.

{$I-} oae poepy oo oa/oa. C oo oa cpoeo y IOResult popae, oo opaaa o oa/oa ca. o yoa coyec {$I+}.

{$N-} eeppye o 8087, o ce oepa c aae oo, coy cpoe 6ao Real. oa a o ea, ye cooac aapaoe oeceee 8087 popaa y. Ec B opyee popay ce oy, coy {$N-}, oea pee oe e peyec Turbo Pascal oppye pey $E. o yoa {$N-}.

{$R-} ae poepy aaoa. p eepa oa e ocyecec poepa oo ecpoa acco e poepec paeoc pcaaex ae oycoy aaoy. o yoa a o oea.

{$S-} ae poepy cea. p eepa oa e poepec ae ocaoo a cea aoo oa poeyp y. o yoa a o oea.

{$V-} oee poepy apaepo var, oope c cpoa. o ooe epeaa aece aecx apaepo cpo, a oopx oa o a, opeeeoo opaoo apaepa var. o yoa a o ea.

{$X+} papeae cooa o y a oepaop; peya oa y oe opoe.

cooae x o oaae opeee pc. ooac ao ocopoo. Ec e popaa oee ce eoo epecayeo, o x ceye o.

oo oooc e x cpec cxo o, eec oooc ycao x c oo e Options/Compiler eppoao cpee c oo o $X oao cpoe, (e X o cooecya ya pe oopa).

O E T HO OP E HT P OB AH H E C PE C TBA C C TE M P O P AMM P OB AH O E T A C A C O O ETOMOHM T T AHH X B OTOPOMO EHEH AHH E PAOT C TM M A H AHH HAC O O ETHO OPEHTPOBAHH M POPAM POBAHEM CB AHO TP OH T EHEHE AHH X M HACE PAH XTOB M X OPAOT OBAHE AHH X METOOB O ETOMHACEHOMOT O ETA ETOOB EPEA OM M MEET MECTO OAOHA TA E H PM ETC APM OP EH EHTAMPAH XTOB H C OHM M M HECO O HTEPPTA O EHEHE AHH X PAH X TOB B EHEM EET EH EPEM EHH O e e o e a B oepaope Type aaec oea yaaec o o oe. oce eo aaec o oea.

Type TData = object Name: string[30];

Date: string[30];

end;

Ha c e o a e o e o Oe oe opeee, a ooo ye cyecyeo oea, .e. o oe aceoa o eo peyeo oea.

Type TData = object Name: string[30];

Date: string[30];

end;

TStudent = object (TDate) Ball: real;

end;

B ao cyae TDate ec poec o, a TStudent ec oep.

e p a Object Oe oe ocac, a a caeca aeca epeea, ccaac a paeey aeco a epeey Type PStudent = ^Tstudent;

Var Stat_st: TStudent;

Din_st: PStudent;

a a o e o e o yoca oeo-opepoao popapoa aa oe oea coy poeypy Init Type TDate = object Name: string[30];

Date: string[30];

Procedure Init (Nm,Dt: string);

end;

Procedure TDate.Init (Nm,Dt string);

Begin Name := Nm; {aa o name} Date := Dt; {aa o date} end;

O p e e e e e o o Byp oea eo opeeec aooo poeyp y, ecye a eo. pe ca eo ocac e opeee oea a oea poeypa y.

Type Tdate = object Name: string[30];

Date: string[30];

Procedure Init (Nm,Dt: string);

Function GetName: strring;

Function GetData: string;

end;

Procedure Tdate.Init (Nm,Dt: string);

Begin Name := Nm ;

Date :=Dt;

end;

Function Tdate.GetName: string;

Begin GetName := Name;

end;

Function Tdate.GetDate: string;

Begin GetDate := Date;

end;

o a x o e o o p a e a p a e p e o o ocoy eo x oe e oy oac ec, opae apaep eoa e oy e oy oe ax oea (a e a poeypax ape a ee oae apaep). Baec cooee Duplicate identifier B e e o e o o y e oea oy oye oe oe co ce eo o eoa. B popae yaaec oy, oopo axoc o oe ocaec ep o oo oea paee oe epeex:

Program Use object;

uses Date; {Moy oopo opeee oe} Var date:Tdate;

e p e o p e e e e e o o epeopeee eoo coy aceoae (p opeee opoeoo a aceyc eo opoaeo a, oao o oy epeopeec). epeopeee aceyeoo eoa ocaec o eo c e e ee, o aceye eo. o c py eo apaepa (p eoxooc).

Tstudent = object (Tdate) Ball: real;

Procedure Init (Nm,Dt: string; bl: real);

Function GetBall: real;

Function GetSum: real;

Procedure ShowSum;

Procedure ShowBall;

end;

Procedure Tstudent.Init (Nm,Dt: string; bl: real);

Begin Tdate.Init (Nm,Dt); {ec oo o cocey aa} Ball := bl;

end;

C o n s t r u c t o r poeypa, oeaa a coae oea. Bo poeype oo o aa oe Type...........

Constructor Init (Nm,Dt: string);

...........

end:

Constructor Tdate.Init (Nm,Dt: string);

begin Name := Nm;

Date := Dt;

end;

D e s t r u c t o r poeypa, oeaa a yoee oea Type...........

Constructor Init (Nm,Dt: string);

...........

Destructor Done;

end:

Constructor Tdate.Init (Nm,Dt: string);

begin Name := Nm;

Date := Dt;

end;

......................

Destructor Tdate.Done;

begin clrscr;

end;

P a c p e o e c o o a e o e p a o p a New B oeo-opepoao popapoa New oe eee a oea aeco oac aa caoo oea c oo oa eo ocpyopa.

Type Pperson = ^Tdate;

Var person: Pperson;

.............

person := New (Pperson);

person := New (Pperson, Init(Alex,05-02-1999));

New (person, Init(Nm,Dt));

P a c p e o e c o o a e o e p a o p a Dispose Oae eey a aeco oac yoae oe o cpeco oa eo Destructora Dispose (person,Done);

PMEP COOBAH OETOB B ACAE: BCEHE HAEH OPEEEHHOO HTEPAA METOAM CMCOHA PMOOHOB {B METOE CMCOHA COETC OPMA Y(X + H) = Y(X) + H ( F(X) + 4F(X + H/2) + F(X + H) ) / 6} uses crt;

const xn = 0.6;

xk = 1.4;

Type Tf=object {Oee oea} h1, x, y1, y2 : real; {o oea} Constructor Init(h:real); {Opeeee eoo} function f(x1:real):real;

function square:real;

function simpson:real;

Destructor Done;

End;

constructor tf.init(h:real); {coae oea aa o h1} begin h1:=h;

end;

function tf.f(x1:real):real;

begin f:= sqrt( x1 ) * cos( x1 ) end;

function tf.square:real;

begin {pace o eoy poyoo} x:= xn; y1:= f(x); y2:= y1 + h1*f(x);

while x < xk do begin x:= x + h1;

y1:= y2;

y2:= y1 + h1*f(x);

end;

square:=y2;

end;

function tf.simpson:real;

begin {pace o eoy Ccoa} x:= xn; y1:= f(x); y2:= y1 + (f(x) + 4*f(x + h1/2) + f(x + h1) ) / 6;

while x < xk do begin x:= x + h1;

y1:= y2;

y2:= y1 + h1 * ( f(x) + 4*f(x + h1/2) + f(x + h1) ) / 6;

end;

simpson:=y2;

end;

Destructor tf.Done; {yoee oea} begin clrscr;

end;

var smp:^tf; {yaae a aec oe} h,y : real;

BEGIN clrscr;

write (' ee h (ppaee apyea) '); read (h);

new(smp,init(h)); {Beee a oea aeco oac aa caoo oea c oo oa eo ocpyopa} writeln (' aee epaa, paccaoe o eoy poyoo, pao ');

writeln (smp^.square);

writeln (' aee epaa, paccaoe o eoy Ccoa, pao ');

writeln (smp^.simpson);

readkey;

dispose(smp,done);

END.

6 POPAMMHOE OECEEHE TEXHOO POPAMMPOBAH e p p o a a c p e a p a p a o p o p a eppoaa cpea ec ac cce papao popa a ax C aca. Borland C++ Borland Pascal e pae, o oe oxoe cpe popapoa.

Oco ococo cpe ec epa eoxox cpec papao popa ey oooy. He xo oopo, popac ee oooc coaa, opoa, o, oaa oppepoa popa.

Paoa ooae apyec a cooa ex e oo. ec ae eec oecoaca oo. Ocoe oepae a cpe popapoa pee a. 24.

pa coco epex ace: aoe e, oo peaopa, oo cooe cpo oepao oca.

24 OEPATBHE AB CPE POPAMMPOBAH a Haaee F2 Coxpae a, axoc a oe peaope.

F3 apya aa (oec apoc e aa).

F5 Haoee ax oo py a pya.

F6 Cea aoo oa.

F7 Boee oepeoo oepaopa popa.

F8 epexo ceye oe.

F9 Coae oe a, o e apyae eo.

F10 Bo aoo e.

ALT F1 Bae pey pa oca.

ALT F2 ape aoo oa.

ALT F9 Tpacpye c pacpee *.OBJ C c pacpee *.TPU acae a, apye peaop.

ALT X Bxo cpe.

CTRL F 1 Bae ocay o eye o ypcopa CTRL F 2 aepee oa popa.

CTRL F 3 Bo cca ax oo.

CTRL F4 pocop ae pae.

CTRL F5 eee paepa ooe aoo oa CTRL F6 oaee pae oo ae.

CTRL F8 caoa oea o ocaoa.

CTRL F9 ayc popa.

Shift Del aee eeoo eca aa apa Shift Ins oeee eeoo eca apaa a.

AB HO E OC HO BH E B A A E ME H FILE cy pao c aa (apya, coxpaee, op, coae, ac a c), a a e paoa c peop (eee peop, pocop peop, xo popa, pee xo DOS).

EDIT o coae peapoae cxox ao.

SEARCH oc eca, poeyp, y eca o.

RUN aoaeca pac, oooa, ayc popa.

COMPILE pac popa oe coe a.

DEBUG ooe ocea o paoa c cooe o oax.

Pages:     | 1 |   ...   | 17 | 18 || 20 | 21 |



2011 www.dissers.ru -

, .
, , , , 1-2 .