დაპროგრამების საფუძვლები - გ. ჯანელიძე
დაპროგრამების საფუძვლები - გ. ჯანელიძე
დაპროგრამების საფუძვლები - გ. ჯანელიძე
g. janeliZe
daprogramebis safuZvlebi
damtkicebulia stu-s
saswavlo-meToduri
sabWos mier
Tbilisi
2002
uak 681.3.06
2
programirebis ena
Turbo Pascal.
Sesavali
pirveli programa.
turbo paskalis enis gasacnobad SevadginoT martivi
programa, romelic raime Setyobinebis gamotanas
ganaxorcielebs paskalis enaze. davuSvaT es aris fraza
`me vaprogrameb turbo paskalze~.
4
Program My_First_Program;
const
Text=’me vaprogrameb turbo paskalze’;
begin
Writeln(Text);
End.
5
wertil-mZimiT (;). es gamyofi turbo paskal enaSi
operatoris an aRweris dasasruls aRniSnavs.
meore striqoni
Const
moicavs erTaderT darezervebul sityvas Const, romelic
aRniSnavs, rom SemdgomSi erTi an ramodenime konstanta
iqneba aRwerili (Constants-konstantebi), enaSi konstantebad
iTvleba programis iseTi obieqtebi romelTac Tavisi
mniSvnelobebis Secvla ar SeuZliaT. konstantas SeiZleba
hqondes sakuTari saxeli. konstantis aRwera turbo
paskalSi niSnavs _ mieTiTos misi saxeli da mniSvneloba.
aseT miTiTebas mesame striqoni Seicavs.
6
programasa da masSi gamoyenebul obieqtebze. programis am
nawils aRweris ganyofileba ewodeba.
meoTxe striqonSi darezervebuli sityva begin
kompilators acnobebs, programis sxva nawilis _
operatorebis ganyofilebis dasawyiss, Cvens magaliTSi es
ganyofileba Seicavs operators:
Writeln(Text); romelsac kompiuteris ekranze Setyobineba
gamoaqvs. mTels programas daasrulebs darezervebuli
sityva End wertiliT. wertili kompilators programis
teqstis dasasruls Seatyobinebs.
End-is Semdeg ganTavsebul teqsts kompilatori ar
kiTxulobs. sanam Sesrulebaze gavuSvebdeT Cvens programas,
ganvixiloT erTaderTi Sesrulebadi operatori:
Writeln(Text); romelic monacemTa gamotanis proceduras
mimarTavs.
procedura operatorebis mimdevrobaa, romelTac SeiZleba
saxeliT mivmarToT.
Writeln procedura miekuTvneba standartul proceduras,
mas winaswar aRwera ar sWirdeba, is nebismieri
programisaTvis xelmisawvdomia, sadac misadmi mimarTvaa.
Writeln procedura miekuTvneba gamotanis operators. misi
sruli saxelia WriteLine _ dawereT striqoni. parametrebi
proceduras gadaecema siis saxiT, romelic Casmulia mrgval
frCxilebSi. Cvens magaliTSi proceduras gadaecema
erTaderTi parametri, mudmiva _ Text.
oTxi gamoyenebuli sityva (Program, const, Begin, End)
darezervebulia. sityva Writeln ar miekuTvneba darezervebuls,
magram misi gamoyeneba sxva daniSnulebiT dauSvebelia.
sityvebi: My_First_Program da Text aris identifikatori.
programists identifikatorad SeuZlia gamoiyenos
simboloebis nebismieri mimdevroba, romlebic Semdeg
moTxovnebs akmayofileben:
7
• identifikatori SeiZleba Sedgebodes
laTinuri anbanis asoebisagan, cifrebisagan,
xazgasmis niSnisagan. danarCeni simboloebi identi-
fikatorSi dauSvebelia.
• identifikatori ar SeiZleba cifriT
iwyebodes.
• identifikatori ar unda emTxveodes arc
erT darezervebul sityvas.
• identifikatoris sigrZe SeiZleba nebismieri
iyos, xolo mniSvnelovnad iTvleba pirveli 63
simbolo.
identifikatorSi yuradReba ar eqceva asoebis simaRles:
Text, text, TEXT.
programis Sesrulebaze gaSvebisas vaWerT [Ctrl-F9] _s,
Tu programaSi Secdoma ar aris Sedegi ekranze daiwereba.
ekranze Sedegis naxvisaTvis vaWerT [Alt-F5] _s. nebismieri
Rilakis daWerisas isev vbrundebiT ZiriTad ekranze.
ganxiluli programis struqturas Semdegi saxe aqvs:
Program My_First_Program;
{aRweris ganyofileba}
Begin
{operatorebis ganyofileba}
End.
sityvebi Program, Begin da End gamoyofs programis or
nawils_aRweris ganyofilebas da operatorebis
ganyofilebas, aseTi struqtura aucilebelia nebismieri
programisaTvis. es enis mkacri moTxovnaa. Sesrulebad
operatorSi gamoyenebuli nebismieri arastandartuli
identifikatori, winaswar unda iyos aRwerili aRweris
8
ganyofilebaSi.
monacemTa ti pebi
ti pi mniSvnelobaTa diapazoni
Byte 0 255
Word 0 65535
Shortint -128 127
9
Integer -32768 32768
Cardinal 0 2147483647
Longint -2147483648
147483647
Const
C1 = 17;
C2 = 3.14;
C3 = ’a’;
C4 = ’123.14’;
C5 = False;
Var
sigma : real;
a,b,c,d : char;
flag : boolean;
(ramdenime erTi ti pis cvladi SeiZleba gavaerTianoT
10
da gamovyoT mZimeebiT).
cvladebis aRwerisas identifikatoris Semdeg iwereba
` : ~ da ti pis saxeli.
ganvixiloT kidev erTi martivi programa. misi
daniSnulebaa Seitanos klaviaturidan ori mTeli ricxvi,
i povos pirveli ricxvis meoreze gayofis Sedegi da
gamoitanos ekranze:
Var
n1, n2 : Integer; {n1,n2-Sesatani mTelebia}
x : Real; {x-Sedegi}
Begin {dasawyisi}
Write(‘n1=’); {vatyobinebT n1-is Setanaze}
readln(n1); {Segvaqvs n1}
Write(‘n2=’);
Readln(n2);
X:=n1/n2; {vpoulobT Sedegs};
Writeln(‘n1/n2=’,X); {gamogvaqvs Sedegi};
End. {dasasruli}
komentarebi turbo paskalSi nebismieri simboloebis
Tanmimdevrobaa, romlebic figurul frCxilebSi Caismis.
komentaris Casma SeiZleba programis nebismier adgilas,
sadac azrobrivad probeli (carieli adgili) SeiZleba
iyos. komentarebis Casasmelad gamoiyeneba figuruli
frCxilebi { da } agreTve wyvili simbolo (* da *)
{ es komentaria}
(*esec komentaria*)
operatorebis wyvili:
Write(..); Readln(..);
11
Semdegnairad muSaobs: dasawyiSi operator Write-s
gamohyavs ekranze striqoni da kursors tovebs axlaxan
gamoyvanili teqstis striqonis bolos. SevniSnoT, rom
operatori
Writeln(Text);
teqstis gamotanis Semdeg asrulebs striqonze gadasvlas
da kursors ayenebs Semdegi striqonis dasawyisSi. Writeln
da Write procedurebi axal striqonze gadasvliT gansxvavdeba
erTmaneTisagan.
< := >, simboloebis wyvili akavSirebs operatoris
marcxena da marjvena nawilebs da niSnavs `mivaniWoT
mniSvneloba~. < := > ganixileba rogorc erTi specialuri
simbolo da aucileblad erTad iwereba.
12
x := 2.0;
iqneba araswori, vinaidan real ti pis integer ti pad
gardaqmna paskalSi dauSvebelia. Tumca turbo paskalSi
aris monacemTa ti pebis gardaqmnis saSualebebi. isini unda
iqnan cxadad gamoyenebuli. monacemTa gardaqmnisaTvis enaSi
arsebobs Casmuli funqciebi, romlebic parametris saxiT
miiRebs erTi ti pis mniSvnelobas, xolo abrunebs sxva
ti pis mniSvnelobas. kerZod, real ti pis integer ti pad
gardaqmnisaTvis aris ori Casmuli funqcia:
ROUND amrgvalebs REAL-s uaxloes mTel ricxvamde.
TRUNC CamoaWris REAL - s wilad nawils. mag. arasworia
Canaweri:
X := Y/X;
magram sworia:
X := ROUND(Y/X);
CHAR (simbolo) ti pis mTel ti pad gardaqmnisaTvis
aris funqcia ORD, xolo ukugardaqmnisaTvis e.i. INTEGER-
is CHAR ti pad gardaqmnas axorcielebs funqcia CHR.
turbo paskalSi gamoiyeneba oTxive ariTmetikuli
operacia:
+ -Sekreba;
_ -gamokleba;
* -gamravleba;
/ -gayofa;
DIV – mTelricxva gayofa.
mag. Canaweri
VAR
N: integer;
begin
N:=1/2;
13
dauSvebelia, vinaidan N aRwerilia, rogorc mTeli
ti pi da is ver miiRebs REAL ti pis mniSvnelobas.
xolo Canaweri:
VAR
X : Real;
begin
X := 1 div 2;
marTebulia.
14
gardaqmnis ara marto simbolos mTel ti pad, aramed
logikur sididesac. amitomac
ORD(FALSE)=0
ORD(TRUE)=1
enis operatorebi
Sedgenili da carieli operatorebi.
15
teqnologiiT (GOTO) gadasvlis operatoris gareSe).
begin
…….
begin
…….
begin
…….
…….
end;
……
end;
…….
end;
16
mTeli ti pebis sademonstracio programa:
Program IntegerDemo;
var
Pay : Integer;
OverTimePay : Integer;
TotalPay : Integer;
begin
Pay : = 500;
OverTimePay : =100;
TotalPay := Pay + OverTimePay;
Writeln (‘sruli daricxva=’, TotalPay);
Readln; {Enter - is daWeramde, rom fanjara Ria darCes}
end.
Program RealDemo;
const
TaxRate = 0.0075;
var
Pay : Real;
OverTimePay : Real;
GrossPay : Real;
NetPay : Real;
begin
Pay : = 500.55;
17
OverTimePay : =100.10;
GrossPay := Pay + OverTimePay;
NetPay := GrossPay - (GrossPay * TaxRate);
Writeln (‘sruli daricxuli Tanxa’, Grosspay : 7 : 2);
Writeln (‘ xelxe gasacemi Tanxa=’, NetPay : 7 : 2);
Readln; {Enter - is daWeramde, rom fanjara Ria darCes}
end.
Program BooleanDemo;
var
OKtoGo : Boolean;
MyFlag : Boolean;
begin
OKtoGo := False;
MyFlag := not OKtoGo;
Writeln (‘OKtoGo-s droSaze arCeulia’, OKtoGo);
Writeln (‘MyFlag-is droSaze arCeulia’, MyFlag);
Writeln(‘ori droSis logikuri `an~ tolia’, OKtoGo or
MyFlag);
Writeln(‘ori droSis logikuri `da~ tolia’, OKtoGo
and MyFlag);
Readln;
end.
18
simboluri ti pis sademonstracio magaliTi:
Program CharDemo;
var
Answer : Char;
Question : Char;
begin
Question :=’A’;
Answer :=’B’;
Writeln (‘SekiTxva udris’, Questin);
Writeln (‘ pasuxi udris’, Answer);
Answer := Question;
Question := ‘B’;
19
striqonis ti pis sademonstracio programa:
Program StringDemo;
var
LastName : String;
FirstName : String[4];
NewFirstName : String[30];
begin
LastName := ‘Mepho’;
FirstName := ‘Tata;
NewFirstName := ‘Kate’;
Writeln (‘saxeli-’, FirstName);
Writel (‘gvari-’, LastName);
FirstName := NewFirstName;
20
pirobis operatori
var
a,b,c,d : integer;
begin
a:=1; b:=2; c:=3; d:=4;
IF a>b then
IF c<d then
IF c<0 then
c:=0
else
a:=b;
IF a>b then
22
IF c then
IF c then
c:=0
else
else
else
a:=b;
var
X, Y, Max : real;
begin
Writeln(‘X=’); Readln(X);
Writeln(‘Y=’); Readln(Y);
If X>Y Then Max := X Else Max := Y;
Writeln(‘Max=’, Max);
Readln;
End.
23
ganvixiloT programis fragmenti, sadac sruldeba Semdegi
piroba, Tu ori namdvili ricxvidan pirveli metia meoreze,
maSin, pirveli davadidoT orjer, xolo Tu meore metia
pirvelze, maSin meore gavadidoT orjer. davuSvaT es
cvladebia a da b.
................................
If a > b Then a := 2 * a
Else b := 2 * b;
-----------------
Var
X : Integer;
Begin
Writeln(‘X=’); Readln(X);
If X > 0 Then X : = 3 * X;
If X = 0 Then X : = 3 + X;
If X < 0 Then X : = -3 * X;
Writeln(‘X=’, X);
Readln;
End.
24
If.....Then.....Else operatoris gamoyenebis martivi programa:
Program IfDemo;
var
UserInput : Integer;
begin
Write (‘ramdeni wlisa xarT?’);
Readln (UserInput);
If (UserInput < 1) or (UserInput > 130) Then
Writeln(‘pasuxi arasworia’)
else
Writeln (‘Tqven ’, UserInput, ‘ wlisa xarT.’);
Writeln(‘programis dasrulebisaTvis daaWireT Enter-s’);
Readln;
end.
25
ciklis (ganmeorebis) operatorebi
FOR – TO cikli
26
var
I, N, S : integer; {cvladebi}
begin
Write(‘N=’); Readln(N); {N Setana}
S := 0; {jamis sawyisi mniSvneloba}
FOR I:=1 TO N do {jamis daTvlis cikli}
S := S + I;
Writeln(‘S=’, S); {Sedegis gamotana}
end.
sanam I icvleba 1-dan N-mde, sruldeba <operatorebi>.
rogorc ki I-s mniSvneloba gadaaWarbebs N-s, cikli wyvets
muSaobas da marTva gadaecema rigiT momdevno operators.
ciklis parametris gazrda +1 erTeuliT mkacrad
gansazRvrulia. arsebobs operatoris sxva forma:
FOR <ciklis parametri> := <sawyisi mniSvneloba>
DOWNTO <saboloo mniSvneloba> DO <operatorebi>
————————
S := 0;
If N >= 0 then
for I := 1 to N do
S := S + I
else
27
for I := -1 downto N do
S := S+I;
—————————
Var
I, N : integer; {cvladebi}
begin
Write(‘N=’); Readln(N); {Segvaqvs N}
FOR I:= N DOWNTO 1 DO
Write(I : 4);
Readln;
end.
…
ganxilul programaSi gamoyenebulia ……FOR -…DOWNTO
cikli, radgan ciklis parametri (-1)-iT unda Seicvalos.
gamotanis operatori …Write(I : 4), niSnavs, rom I-is
yoveli momdevno mniSvnelobis gamotana moxdeba imave
striqonze, amave dros yoveli momdevno I ekranze daibeWdeba
wina mniSvnelobidan meoTxe poziciaze.
28
ciklis operatori wina pirobiT.
WHILE – DO cikli.
var
i, n : integer;
begin
Writeln(‘n=’); Readln(n);
i := 1;
While i <= n do begin
Writeln (i);
i := i + 2; end;
Readln;
end.
29
WHILE – DO ciklSi ciklis parametri, Cvens SemTx-
vevaSi i, icvleba nebismieri intervaliT, amitom misi
cvlileba aucileblad unda iyos miTiTebuli.
var
i, n, s : integer;
begin
Writeln(‘n=’); Readln(n);
i := 2;
s := 0;
While i <= n do begin
s := s + i;
i := i + 2; end;
Writeln(‘s=’, s);
Readln;
end.
30
ciklis operatori bolo pirobiT
REPEAT – UNTIL cikli
var
i, n : integer;
begin
Writeln(‘n =’); Readln(n);
i := 2;
Repeat
Writeln (i);
i := i + 2;
Until i > n;
End.
31
Until _ is win ` ; ~-is dasma ar aris aucilebeli.
FOR – TO, WHILE – DO, REPEAT – UNTIL ciklis
operatorebis moqnili marTvisaTvis turbo paskalSi
gamoyenebulia ori procedura:
BREAK _ romelic ciklidan dauyovnebliv gamosvlas
axorcielebs da marTva gadaecema ciklis dasasrulis
momdevno operators.
CONTINUE _ uzrunvelyofs ciklis momdevno
ganmeorebis vadaze adre dasrulebas. igi ciklis
operatoris bolo operatorze mimarTvis eqvivalenturia.
am procedurebis Semotana praqtikulad gamoricxavs
GOTO gadasvlis upirobo operatoris gamoyenebas.
Program ForDemo;
var
count : Integer;
begin
For Count := 1 to 10 do
Writeln (‘gamarjobaT!’);
Writeln(‘programis dasrulebisaTvis daaWireT Enter-s’);
Readln;
end.
32
Program WhileDoDemo;
Var
I : Char;
begin
I := ‘ ‘;
While (I < > ‘q’) and (I < > ‘Q’) Do
begin
Write (‘S e i t a n e T s i m b o l o ( p r o g r a m i s
dasrulebisaTvis SeitaneT q an Q) : ‘);
Readln(I);
end;
Writeln (‘programis dasrulebisaTvis daaWireT Enter-s’);
Readln;
end.
Program RepeatDemo;
Var
I : Char;
begin
Repeat
Write (‘SeitaneT simbolo (programis dasrulebisaTvis
SeitaneT q an Q) : ‘);
Readln(I);
Until (I = ‘q’) or (I = ‘Q’) ;
33
Writeln (‘programis dasrulebisaTvis daaWireT Enter-s’);
Readln;
end.
amorCevis operatori
34
amorCevis gasaRebis mniSvnelobas, maSin marTva gadaecema
ELSE-s Semdgom operators.
ELSE < operatori> SeiZleba gamotovebul iqnes, maSin
mocemul siaSi saWiro mudmivas aryofnis SemTxvevaSi
araviTari moqmedeba ar sruldeba da amorCevis operatori
ubralod amTavrebs muSaobas. amorCevis siis operatorebSi
SeiZleba monawileobdes ara erTi aramed ramodenime
amorCevis mudmiva, romlebic erTmaneTisagan mZimiTaa
gamoyofili. mag. Semdegi programa y an Y simbolos Setanisas
ekranze gamoitans sityvas `diax~, xolo N an n Setanisas
sityvas `ara~.
mag.:
Var
ch : char;
begin
readln(ch);
case ch of
‘n’,’N’: Writeln(‘ara’’);
‘y’, ‘Y’: Writeln(‘diax’);
end;
end.
35
ganvixiloT programa amorCevis operatoris gamoyenebiT:
Program CaseDemo;
var
UserIn : Char;
begin
Writeln (‘SeitaneT erTi simbolo da daaWireT Enter-
s’);
Readln (UserIn);
Case UserIn of
‘a’ : Writeln (‘es weriTi a simboloa’);
‘z’, ‘Z’ : Writeln (‘es weriTi an beWdviTi z simboloa’)
else
Writeln (‘es simbolo gansxvavebulia a, z, Z - sagan’);
end;
Writeln (‘programis dasrulebisaTvis daaWireT Enter-
s’);
Readln;
end.
36
Program calc;
Var
Operacion : char;
X, Y, Z : Real;
stop : boolean;
begin
stop := false;
repeat
Writeln;
Write (‘X, Y=’);
Readln(X, Y);
Write(‘operacia’);
Readln(Operacion);
Case Operacion of
‘+’ : Z := X + Y;
‘-’ : Z := X - Y;
‘*’ : Z := X *Y;
‘/’ : Z := X / Y;
else
stop := true;
end;
if not stop then
Writeln (‘Z=’, Z);
until stop; end.
37
programa Setanili mimdinare TariRis mixedviT gamoitans
momdevno dRis TariRs(ricxvs, Tves da wels);
Program callendar;
var
month, day, year, nom : integer;
begin
38
4, 6, 9, 11 : if day = 30 then begin
day := 1; month:= succ(month);
end
else
day := day + 1;
12 : if day = 31 then begin day := 1; month := 1;
year := year + 1; end
else
day := day + 1;
2 : if (day = 28) and (year mod 4 < > 0) or (dd = 29) then
begin
day := 1; month := succ(month); end
else
day := day + 1; end;
Writeln (month);
Writeln (day);
Writeln (year);
Readln;
end.
39
gamoyenebam SeiZleba gaamartivos programa.
gadasvlis operators aqvs Semdegi saxe:
GOTO – <Wde>
LABEL
Loop, Lb1, Lb2;
begin
………
goto Lb1;
………
Loop : ………
………
Lb1 : Lb2 : …….
………
goto Lb2;
………
40
goto operatoris moqmedeba mdgomareobs daniSnul
operatorze marTvis gadacemaSi. Wdis gamoyenebisas
aucilebelia gaviTvaliswinoT Semdegi wesebi :
• Wde aucileblad unda aRiweros aRweris nawilSi
da aucileblad monawileobdes operatorebis nawilSi.
• Wde, romelic aRwerilia proceduraSi an funqciaSi,
lokalizebulia mxolod maTTvis.
masivis ti pi.
ARRAY [T1] of T2
41
E : ARRAY[COLOR] OF REAL;
begin
Readln; Write(‘XS=> ‘);
For I:=1 to 6 do Read(XS[I]);
42
(*fragmenti 2*)
Readln; Write(‘XF=>’);
For I := 1 to 3 do
for J := 1 to 2 do Read (XF[I, J]);
(*fragmenti 1*)
(fragmenti 2*)
For I:=1 to 3 do
begin
For J:=1 to 2 do Write (XF[I, J] : 6 : 2);
Writeln;
end.
43
A : Array[1..N] of Integer;
I, S : Integer;
begin
Writeln (‘masivi’);
For I:=1 to N do Readln (A[I]);
S := 0;
For I := 1 to N do S := S + A[I];
Writeln (‘S = ’, S);
end.
ganvixiloT programa, romelic Sekrebs MM matricis
TiToeuli striqonis dadebiT elementebs da miRebuli
jamisagan aagebs VV veqtors.
For I = 0 to 5 do
begin
S := 0;
For J := 0 to 9 do
If MM[I, J] > 0 then S := S + MM[I, J];
VV[I]:=5;
end.
44
Program ……….;
const
N = 10;
var
K , I : Integer;
M : Array[1..N] of Integer;
begin
K := 0;
Write (‘masivi=>’);
For I := 1 to N do readln (M[I]);
For I := 1 to N do
If M[I] mod 2 = 0 then
K:=K+1;
Writeln (‘luwi elementebis raodenoba=’, K);
end.
programa iTvlis aTelementian masivSi kentindeqsiani
wevrebis jams:
Program ……..;
const
N=10;
var
M : Array[1..N] of Integer;
I, S : Integer;
begin
45
Writeln (‘masivi=>’);
For I:=1 to N do readln (M[I]);
S := 0; I := 1;
Repeat
S := S + M[I];
I := I+2;
Until I>N; Writeln(‘S=’, S) ;
end.
simravle
type
digitchar = set of ‘0’..’9’ ;
digit = set of 0..9;
46
var
S1, S2, S3 : digitchar;
S4, S5, S6 : digit;
…………………..
S1 := [‘1’,’2’,’3’];
S2 := [’3’,’2’,’1’];
S3 := [‘2’,’3’];
S4 := [0..3, 6];
S5 := [4, 5 ];
S6 := [3..9];
am magaliTSi simravle S1 eqvivalenturia S2-sa, S3
CarTulia S2 –Si, magram misi eqvivalenturi ar aris.
simravlis aRweras aqvs Semdegi saxe:
<ti pis saxeli> = set of < bazuri ti pi>
<ti pis saxeli> - identifikatoria.
set, of darezervebuli sityvebia (simravle, dan).
<baz. ti pi> - simravlis elementebis bazuri ti pia,
romlis saxiT SeiZleba gamoyenebul iqnas nebismieri ti pi,
garda Word, Integer, Longint.
47
gansxvavebul elementebs.
S4 + S5 Seicavs [0, 1, 2, 3, 4, 5, 6,];
3 in S6 - TRUE
2 * 2 in S1 - FALSE.
48
programa ekranidan Setanil ricxvs Seamowmebs martivia
Tu ara da gamoscems Sesabamis Setyobinebas:
Program SetOfDemo;
const
n = 201;
Type
mn = set of 2..n;
var
m, pm : mn;
q, i, k, p : integer;
begin
m := [2..n]; pm := [ ];
p := 2;
Repeat
While not (p in m) do p := p + 1;
pm := pm + [p];
k := p;
Repeat m := m - [k]; k := k + p; Until k > n;
Until m = [ ];
Writeln;
Repeat
Writeln(‘q’); Readln(q);
If q in pm then Writeln(q, ‘martivia’)
else
Writeln (q, ‘ar aris martivi’);
UUntil q > 201;
Readln;
end.
49
striqonis ti pi
mag.:
var
st : String;
begin
……………………….
50
ST := ’A’+’B’;
ST := ST + ’C’; {ST Seicavs ‘ABC’}
51
COPY (‘Branka’, 2,1) -> ‘r’
52
Caiara warmatebiT, CODE Seicavs nuls, xolo Tu gadayvanam
warmatebiT ar Caiara, maSin CODE Seicavs ST striqonis
im poziciis nomers, sadac napovni iqneba SecdomiTi simbolo,
carieli adgili striqonSi ar unda iyos.
var
x : Real ;
y : Integer ;
st, st1 : String ;
begin
st := concat (‘12’,’345’); {st striqoni Seicavs 12345}
st1 := copy (st, 3, Length(st)-2); {st Seicavs 345}
Insert(‘-‘, st1, 2); {st1 Seicavs 3-45}
Delete (st, pos(‘2’, st, 3)); {st striqoni Seicavs 15}
Str (p1 : 6 : 2, st); {st striqoni Seicavs 3-
53
14}
Val (‘3,1415’, x, y); {y Seicavs 2, x darCa ucvleli}
end.
=, < >, >, <, >=, <= damokidebulebis operaciebi sruldeba
or striqonze. Sedareba xdeba simboloebis mixedviT.
qvemoT ganxiluli operaciebi mogvcems TRUE
mniSvnelobas:
‘’’’<’.’
‘A’ > ’1’
‘Turbo’ < ‘Turbo Pascal’
Program ………;
var
k, ch : String; I : Integer;
begin
Readln (ch);
for I := 1 to length(ch) do begin
k[I] := Upcase(ch[I]); Write(k[I]);
end;
Readln;
end.
54
programa aerTianebs or striqons da beWdavs
ukumimdevrobiT, iTvlis gaerTianebuli striqonis sigrZes
da gamoaqvs ekranze:
Program StringDemo;
var
St1, St2 : String[15];
St : String;
I, K : Integer;
begin
Writeln (‘St1, St2’);
Readln (St1, St2);
St := Concat (St1,’ ‘, St2);
K := Length (St);
For I := K Downto 1 Do
Write(St[I]);
Writeln(‘gaerTianebuli striqonis sigrZea ’, K);
Readln;
end.
55
obieqturi paskali.
(Object Pascal)
Canawerebi
Program MyRecordDemo ;
uses
forms ;
type
PersonalRecordType=Record
Name : String[30];
PhoneNumber : String[13];
Age : Integer;
Sex : Char;
end; {PersonalRecordType}
var
Person : PersonalRecordType;
begin
Person.Name := ‘Dan Osier’;
Person.PhoneNumber := ‘(916)555-1212’;
Person.Age :=32;
56
Person.Sex := ‘M’;
Writeln(‘The Person’ ‘ s name is ‘, Person.Name);
Writeln (‘The Person’ ’s Phone number is ‘, Person.PhoneNumber);
Writeln(‘The Person’ ’ s age is ‘, Person.Age);
Writeln(‘The Person’ ’ s sex is ‘, Person.Sex);
Readln; {fanjara rom darCes gaxsnili, sanam ar
davaWerT Enter Rilaks}
end. {MyRecordDemo}
57
Canawerisagan. TiToeuli es Canaweri Seicavs informacias
pirovnebis Sesaxeb, rogoricaa gvari, telefonis nomeri
da ase Semdeg.
ganvixiloT Canaweris ti pis martivi magaliTi.
Program MyRecordDemo ;
uses
forms ;
type
PersonalRecordType=Record
Name : String[30];
PhoneNumber : String[13];
Age : Integer;
Sex : Char
end; {PersonalRecordType}
MyArrayType=array [1..3] of PersonRecordType;
var
PersonArray : MyArrayType;
begin
PersonArray[1].Name := ‘Dan Osier’;
PersonArray[1].PhoneNumber := ‘(916)555-1212’;
PersonArray[1].Age :=32;
PersonArray[1].Sex := ‘M’;
PersonArray[3].Name := ‘Pat’;
PersonArray[3].PhoneNumber := ‘(916)555-7766’;
PersonArray[3].Age :=30;
PersonArray[3].Sex := ‘M’;
58
Writeln(‘pirveli TanamSromlis saxeli‘, PersonArray[1].Name);
Writeln (‘telefonis nomeri ‘, PersonArray[1].PhoneNumber);
Writeln(‘asaki‘, PersonArray[1].Age);
Writeln(‘sqesi ‘, PersonArray[1].Sex);
Program MyRecord2demo ;
uses
59
Forms;
type
AddressType=record
Street : String [50];
City : String [20];
State : string [2];
ZipCode : String [10]
end; {addressType}
PersonType = record
LastName : String[20];
FirstName : String [10];
EmployeeNumber : Integer;
HomeAddress : AddressType;
WorkAddress : AddressType;
end; {PersonType}
var
Employee : PersonType;
begin
Employee.LastName := ‘Osier’;
Employee.FirstName := ‘don’;
Employee.EmployeeNumber := 16253;
60
Writeln (Employee.LastName);
Writeln(Employee.FirstName);
Writeln(Employee. EmployeeNumber);
Writeln (Employee.HomeAddress.Street);
Writeln (Employee.HomeAddress.City);
Writeln (Employee.HomeAddress.State);
Writeln (Employee.HomeAddress.ZipCode);
Writeln (Employee.WorkAddress.Street);
Writeln (Employee.WorkAddress.City);
Writeln (Employee.WorkAddress.State);
Writeln (Employee.WorkAddress.ZipCode);
61
Program MyRecord3demo ;
uses
Forms;
type
AddressType=record
Street : String [50];
City : String [20];
State : string [2];
ZipCode : String [10]
end; {addressType}
PersonType = record
LastName : String[20];
FirstName : String [10];
EmployeeNumber : Integer;
HomeAddress : AddressType;
WorkAddress : AddressType;
end; {PersonType}
var
Employee : PersonType;
begin
With Employee do
begin {With operatoris dasawyisi}
LastName := ‘Osier’;
FirstName := ‘don’;
EmployeeNumber := 16253;
end; {With Employee-s dasasruli}
With Employee.HomeAddress do
begin {with operatoris dasawyisi}
Street := ‘1313 Your St.’;
City := ‘MyTown’;
62
State := ‘Ca’;
ZipCode := ‘95630-0011’;
end; {with Emloyee.HomeAddress dasasruli}
With Employee.WorkAddress do
begin { with dasawyisi}
Street := ’14 Big Business Road.’;
City := ‘NoOzone’;
State := ‘CA’;
ZipCode := ‘95636-2211’;
end; {with Employee.WorkAddress dasasruli}
With Employee do
begin {with dasawyisi}
Writeln(LastName);
Writeln(FirstName);
Writeln(EmployeeNumber);
end; {with Employee dasasruli}
With Employee.HomeAddress do
begin {with dasawyisi}
Writeln (Street);
Writeln (City);
Writeln (State);
Writeln (ZipCode);
end; {with Employee.HomeAddress dasasruli}
With Employee.WorkAddress do
begin {with dasawyisi}
Writeln (Street);
Writeln (City);
Writeln (State);
63
Writeln (ZipCode);
end; {with Employee.WorkAddress dasasruli}
end. {MyRecord3Demo}
ti pizebuli mudmiva.
Program TypedConstantDemo;
uses
Forms;
const
MyName : String = ‘Dan Osier’;
begin
Writeln(‘Cemi saxelia’, MyName);
MyName := ‘Jim Fisher’;
Writeln(‘Cemi axali saxelia’, MyName);
Readln;
end.
64
es programa iwyeba MyName ti pizebuli mudmivas
gamocxadebiT, romelic String ti pisaa da misi sawyisi
mniSvnelobaa ‘Dan Osier’. dasawyisSi daibeWdeba MyName
-is mniSvneloba, imis dasadastureblad, rom ti pizebuli
mudmivasaTvis SesaZlebelia sawyisi mniSvnelobis miniWeba.
Semdgom MyName – mniSvneloba icvleba ‘Jim Fisher’ – ze
da is ibeWdeba. es niSnavs, rom ti pizebuli mudmivas
mniSvneloba SeiZleba ASeicvalos programis Sesrulebis
procesSi.
CamoTvliTi ti pi.
Program MyEnumeratedDemo ;
uses forms ;
type
StopLightColors = (Red, Yellow, Green) ;
var
MyLight : StopLightColors;
65
begin
MyLight := Red;
Writeln(‘Cemi mimdinare feria-’, Integer(MyLight));
MyLight := Green;
Writeln(‘axali feria’, Integer(MyLight));
Readln;end.
variantis ti pi.
Program MyVariantDemo ;
uses
Forms ;
var
MyInput : Variant ;
begin
MyInput := 3.5555;
Writeln (MyInput);
66
Writeln (MyInput);
MyInput := 4;
Writeln (MyInput);
Readln;
end.
ganStoeba
Goto
Break
Continue
Exit
67
Halt
RunError
Goto
Program GotoDemo ;
Uses
Forms ;
var
Ansver : String ;
Label ThePlace ;
begin
ThePlace : Writeln (‘ gamarjobaT !’) ;
Writeln (‘gnebavT gavimeoroT kidev ?’) ;
Readln (Answer) ;
if (Answer = ‘y’) or (Ansver = ‘Y’) Then
Goto ThePlace ;
Writeln (‘programis dasrulebisaTvis daaWireT enter-s”) ;
Readln ;
end.
68
radgan arsebobs sxva xerxebi am operatoris Sesacvlelad.
Break.
Program BreakDemo ;
uses
Forms ;
var
I : Char ;
begin
I : =‘ ‘ ;
While TRUE Do
Write ( ‘muSaobis damTavrebisaTvis SeitaneT q an Q’) ;
Readln (I) ;
If (I=’q’) or (I=’Q’) Then
Break ;
end ;
{ Break brZanebis Sesrulebas gadmovyavarT aq}
Writeln (‘daaWireT enter-s programis dasrulebisaTvis’) ;
Readln ; {enter-is daWeramde rom fanjara Ria iyos} ;
end. {BreakDemo}
69
Tu iyo daWerili, maSin sruldeba Break
Continue
70
simbolo moTavsdeba I cvladSi. Tu davaWerT “q~ an
“Q~ Rilaks, amuSavdeba Continue operatori da daabrunebs
marTvas For ciklze, romelic For ciklSi Count cvlads
daumatebs erT erTeuls da gaagrZelebs Semdeg iteracias.
Exit
Exit operatori gamoiyeneba programis mimdinare
blokidan gamosasvlelad. Tu es bloki aris ZiriTadi
programa, maSin Exit operatori wyvets mis muSaobas, Tu
mimdinare blokia CarTuli, maSin Exit operatori gadascems
marTvas gare blokis operators, romelic im operatoris
momdevnoa, romelzc iyo gadacemuli marTva am CarTul
blokSi. Tu mimdinare bloki procedura an funqciaa, maSin
gamoZaxebuli blokis Sesruleba Sewydeba da marTva
gadaecema misi gamoZaxebis operatoris momdevno operators
Program Exitdemo;
uses
Forms ;
var
I : Char ;
begin
Repeat
Write (‘S e i t a n e T s i m b o l o Q m u S a o b i s
damTavrebisaTvis) ;
Readln (I)
If I=’Q’ then
Exit ;
Until FALSE ;
Writeln (‘es operatori arasodes ar sruldeba’) ;
end.
71
Until False operatoriT. ciklis damTavrebisaTvis unda
SevitanoT “Q~ simbolo, am SemTxvevaSi amoqmeddeba Exit
operatori.
Halt
Program HaltDemo ;
uses
Forms ;
var
I : Char ;
begin
Repeat
Write (‘dasrulebisaTvis daaWireT Q – s’) ;
Readln (I) ;
If I=’Q’ then
Halt ;
Until FALSE ;
Writeln (‘es operatori arasodes ar Sesruldeba’) ;
end.
RunError
72
Program RunErrorDemo ;
uses
Forms ;
var
I : Char ;
begin
repeat
Write ( ‘dasrulebisaTvis SeitaneT Q simbolo’) ;
Readln (I) ;
If I=’Q’ then
RunError (2400 ;
Until False ;
Writeln (‘es operatori arasodes ar Sesruldeba’) ;
end.
failis ti pi
73
konkretdeba mxolod programis Sesrulebis procesSi. es
ti pi aris – failis ti pi. pirobiTad faili SeiZleba
warmovidginoT rogorc lenta, romelsac aqvs dasawyisi,
xolo dasasruli ar aris dafiqsirebuli. failis elementebi
am lentze Caiwereba mimdevrobiT, erTmaneTis gverdiT.
F {F1, F2, F3 ………………..}
Type
<saxeli> = FILE OF <ti pi>; (1)
<saxeli> = TEXT; (2)
<saxeli> = FILE; (3)
74
elementad.
rogorc vxedavT, faili informaciis erTobliobaa,
romelic SeiZleba damaxsovrebul da aRdgenil iqnes
diskidan. failebSi SeiZleba Seinaxos programis teqsti,
dokumenti, Sesasruleblad momzadebuli programebi da
a.S.
TiToeul fails aqvs saxeli, romelic Sesdgeba ori
nawilisagan: saxeli da gafarToeba. saxeli Sedgeba 1-dan
8-simbolosagan, gafarToeba iwyeba wertilidan da Sedgeba
1 - dan 3 – simbolosagan. magaliTad:
command.com
paper.chi
autoexec.bat
75
informacia anu isini warmoadgenen failidan wakiTxuli
informaciis wyaroebs.
roca kavSiri gare failTan damyarebulia, Setana-
gamotanis operaciebisaTvis mis mosamzadeblad failuri
cvladi unda gaixsnas. arsebuli faili SeiZleba gaixsnas
RESET proceduris meSveobiT, xolo axali faili SeiZleba
Seiqmnas da gaixsnas REWRITE proceduris meSveobiT.
teqsturi failebi, romlebic gaxsnili arian RESET
proceduriT, misawvdomia mxolod wasakiTxad, xolo
teqsturi failebi, romlebic gaxsnilni arian REWRITE
proceduriT, misawvdomia mxolod Casawerad, ti pizirebuli
da ara ti pizirebuli failebisaTvis dasaSvebia rogorc
wakiTxva, aseve Cawera miuxedavad imisa, isini gaxsnili
arian RESET Tu REWRITE procedurebiT.
rogorc adre avRniSneT, failze mimarTva xorcieldeba
mimdevrobiT, anu roca elementi waikiTxeba stanadartuli
procedura READ - iT an Caiwereba standartuli
procedura WRITE - iT, failis mimdinare pozicia
gadaadgildeba failis Semdeg elementze. Tumca tipizebul
da arati pizebul failebze SeiZleba organizebuli iqnas
pirdapiri mimarTva SEEK standartuli proceduris
meSveobiT, romelic failis mimdinare pozicias
gadaaadgilebs mocemul elementze.
failSi mimdinare poziciisa da mimdinare zomis
gansazRvrisaTvis SeiZleba gamoyenebul iqnas standartuli
funqciebi: FILEPOS da FILESIZE.
rodesac programa daasrulebs failis damuSavebas, is
unda daixuros CLOSE standartuli proceduriT . failis
sruli daxurvis Semdeg failuri cvladi SeiZleba
daukavSirdes sxva gare fails.
moviyvanoT im procedurebisa da funqciebis sruli sia,
romlebic gamoiyeneba yvela failisaTvis:
76
procedura Assign - failuri cvlads acnobebs gare
failis saxels;
77
teqsturi faili
procedurebi da funqciebi teqsturi failebis
damuSavebisaTvis
78
Assign ( Input, “); Reset ( Input );
Assign (Output,”) ; Rewrite ( Output );
analogiurad, programis muSaobis dasrulebisas es
failebi avtomaturad ixureba.
sia, romelic moyvanilia mocemul nawilSi, zogierTi
standartuli procedurebisaTvis ar moiTxovs parametris
saxiT failuri cvladis cxadad Cvenebas. Tu es parametri
gamotovebulia, maSin igulisxmeba Input an Output, imis
mixedviT procedura an funqcia orientirebulia Setanaze
Tu gamotanaze.
mag: Read(X) Seesabameba Read ( Input, X)
Write(X) Seesabameba Write(Output, X)
Tu qvemoT moyvanili romelime proceduris an funqciis
gamoZaxebisas iZleviT fails, maSin es faili unda
daukavSirdes gare fails Assign proceduris meSveobiT
da gaixsnas Reset, Rewrite an Append procedurebiT.
Tu gamotanaze orientirebuli proceduris an
funqciisaTvis uCvenebT fails, romelic gaxsnili iyo Reset
proceduriT, gamova Setyobineba Secdomaze. analogiuri
Secdoma iqneba, Setanaze orientirebuli proceduris an
funqciisaTvis davasaxeloT faili, romelic gaxsnilia
Rewrite an Append procedurebiT.
procedura Append - xsnis arsebul fails dasamateblad;
procedura Eoln - fails aZlevs striqonis dasasrulis
mdgomareobas (End_of_Line);
procedura Fluch - asufTavebs gamomavali failis
bufers;
procedura Read - teqsturi failidan waikiTxavs erT
an met mniSvnelobas da mianiWebs erT an met cvlads;
procedura Readln - asrulebs igive moqmedebas, rasac
Read, Semdeg akeTebs gamotovebas failis Semdegi striqonis
dawyebamde.
funqcia SeekEof - fails aZlevs failis dasasrulis
79
funqcia SeekEoln - fails aZlevs striqonis dasasrulis
mdgomareobas;
Program FileDemo;
var
X, Y : Integer;
F1, F2 : File Of Integer;
begin
Assign(F1, ‘Cifr’);
Assign (F2, ‘Fact’);
Rewrite (F1);
Rewrite (F2);
X := 1; Y := 1;
Repeat
X := X + 1;
Y := Y * X;
Write (F1, X); Write (F2, Y);
80
Until X > 5;
Close(F1); Close(F2);
Reset (F1); Reset (F2);
Repeat
Read (F1, X); Read (F2, Y);
Writeln(‘ricxvi=’, X, ‘ ‘, ‘faqtoriali=’, Y);
Until Eof (F1);
Close (F1); Close (F2);
Readln;
end.
81
mdgomareobas (End_of_File);
82
erT an met Canawers;
teqsturi failis garda, nebismieri tipis failuri
cvladisaTvis dasaSvebia Semdegi procedurebisa da
fuqciebis gamoyeneba:
FilePos - gvaZlevs failis mimdinare pozicias;
FileSize - gvaZlevs failis mimdinare zomas;
Seek - iZlva failze pirdapiri mimarTvis saSualebas;
Truncate - CamoaWris fails mocemul poziciamde.
procedurebi.
83
Writeln (‘ | | | | |‘) ;
end ;
Procedure DoHorizontals;
begin
Writeln (‘————‘) ;
end ;
begin
DoVerticals ;
DoHorizontals ;
DoVerticals ;
DoHorizontals ;
Writeln (‘daaWireT enter – s programis dasrulebisaTvis’) ;
readln ; {enter – is daWeramde Ria rom iyos fanjara} ;
end.
programaSi Seqmnilia ori procedura, erTi
horizontaluri xazebis dasabeWdad, meore ki –
vertikaluri xazebis dasabeWdad.
proceduris Sesaqmnelad unda davweroT proceduris
saTauri, romelic Sedgeba Procedure sityvisagan da misi
unikaluri saxelisagan, Cvens SemTxvevaSi es aris DoVerticals,
DoHorizontals. procedura aris mini programa da igive
formati aqvs, rac Cveulebriv programas. saTauris Semdeg
SeiZleba gvqondes const, var da a.S. amis Semdeg modis
Sesasrulebeli nawili begin…end. proceduris gamoZaxeba
xdeba ZiriTadi programidan misi unikaluri saxelis
mixedviT. roca proceduris Sesruleba damTavrdeba, marTva
gadaecema proceduris gamoZaxebis Semdgom proceduras.
imisaTvis rom procedura iyos ufro moqnili,
proceduras unda gadaeces damatebiTi monacemebi. es
xorcieldeba proceduraze parametrebis gadacemiT.
84
DoHorizontals procedura For…Do ciklis
gamoyenebiT :
Procedure DoHorizontals (HowManyTimes : Integer) ;
var
Count : Integer ;
begin
for Count := 1 to HowManyTimes do
Writeln (‘—————‘) ;
Writeln(‘ programis dasrulebisaTvis daaWireT enter
Rilaks‘);
Readln; end .
es procedura Seicavs HowManyTimes cvlads. kods
(HowManyTimes : Integer) hqvia formaluri parametrebis
sia. es aris monacemTa sia, romelic gadaecema proceduras
yoveli gamoZaxebisas, ti pis CvenebiT. Cvens SemTxvevaSi
cvladi Integer-is ti pisaa, romelic gansazRvravs Tu
ramdenjer unda Sesruldes Writeln operatori. DoHorizontals
proceduras aqvs mTeli ti pis cvladi – HowManyTimes,
romelic gamoiyeneba proceduris SigniT. mocemul
SemTxvevaSi proceduras DoHorizontals ver gamoviZaxebT
mxolod saxeliT, aqve unda vaCvenoT faqtiuri parametrebi.
formaluri da faqtiuri parametrebi erTnairi ti pis
unda iyos.
Program ParamDemo ;
uses
Forms ;
var
Number : Integer ;
Procedure DoHorizontals (HowManyTimes : Integer) ;
var
Count : Integer ;
begin
85
for Count := 1 to HowManyTimes do
Writeln(‘————‘) ;
end ; {DoHorizontals proceduris dasasruli} ;
begin
Writeln (‘ramdeni horizontaluri xazis dabeWdva
gnebavT?’) ;
Readln (Number) ;
DoHorizontals (Number) ;
Writeln (‘ d a a W i r e T enter-s p r o g r a m i s
dasrulebisaTvis’) ;
Readln ;
end.
86
Writeln (‘Number-is raodenoba udris’ , Number) ;
Writeln(‘String striqoni udris’, Stuff) ;
end ; {Procedure Junk} ;
begin
Write (‘SeitaneT Tqveni striqoni’) ;
Readln (UsersString);
Write (‘SeitaneT ricxvi’) ;
Readln (UsersNumber) ;
Junk (UsersNumber, UsersString) ;
Writeln ;
Readln ;
end.
funqciebi
Program FunctionDemo ;
uses
Forms ;
var
87
UserInput : Integer ;
begin
Write(‘SeitaneT ricxvi, romlis kvadratSi ayvana
gsurT’) ;
Readln (UserInput) ;
Writeln (UserInput, ‘ kvadratSi tolia’, Sqr
(UserInput)) ;
Writeln (‘d a a W i r e T enter-s p r o g r a m i s
dasrulebisaTvis’) ;
Readln ;
end.
Program FunctionDemo ;
uses
Forms ;
Function Square (TheInput : Integer) : Integer ;
begin
Square := TheInput * TheInput ;
end ;
var
UserInput : Integer ;
begin
Write (‘ SeitaneT ricxvi, romlis kvadratSi ayvana
88
gsurT’) ;
Readln (UserInput) ;
Writeln (UserInput, ‘ kvadratSi tolia’, Square
(UserInput)) ;
end.
qveprogramebi .
standartuli qveprogramebi
Pprocedura DDelay
sintaqsi: Delay (Time)
89
Time miliwamis ganmavlobaSi. Tu Time-s aqvs uaryofiTi
mniSvneloba, iTvleba, rom mas aqvs mniSvneloba_0.
Pprocedura: Randomize
sintaqsi: Randomize
ariTmetikuli funqciebi
Ffunqcia abs
sintaqsi: abs(num)
funqcia ArcTan
sintaqsi: ArcTan(Num)
Num - real an integer - is ti pisaa. Ffunqcia ArcTan
gvaZlevs kuTxis namdvil mniSvnelobas, romlis tangensi
aris Num.
Mmag. ArcTan(0)=0.0
ArcTan(pi)=0.7853981634
F funqcia Cos
sintaqsi: Cos( Num)
Num aris real an integer-is ti pis gamosaxuleba. Ffunqcia
90
Cos iZleva Num kuTxis kosinusis namdvil mniSvnelobas
Mmag. cos(0)=1.0
cos(pi)=-1.0
funqcia Exp
sintaqsi: Exp(Num)
Num - real an integer-is ti pis gamosaxulebaa. funqcia
Exp gvaZlevs Num- is eqsponentis namdvil mniSvnelobas:
Ffunqcia Frac
sintaqsi: Frac(Num)
Num aris real an integer-is ti pis gamosaxuleba.
Ffunqcia Frac gvaZlevs namdvil ricxvs, romelic warmoadgens
Num-is wilad nawils.
Mmag. Frac(3)=0.0
Frac(Pi)=0.1415926536
Ffunqcia Int
sintaqsi: Int(Num)
Num - real an integer-is tipis gamosaxulebaa. Ffunqcia
Int gvaZlevs namdvil ricxvs, romelic warmoadgens Num-is
mTel nawils.
Mmag. Int(2)=2.0
Int(Pi)=3.0
Ffunqcia Ln
sintaqsi: Ln(Num)
Num - real an integer-is tipis gamosaxulebaa. Ffunqcia
Ln gvaZlevs Num-dan naturaluri logariTmis
mniSvnelobas.
Mmag: Ln(1)=0.0
Ln(3)=1.0986122887
F
91
funqcia Sin
sintaqsi: Sin(Num)
Num - real an integer-is tipis gamosaxulebaa. Ffunqcia
Sin gvaZlevs Num argumentidan sinusis mniSvnelobas.
Mmag: Sin(0)=0.0
Sin(Pi/2)=1.0
F
funqcia Sqr
sintaqsi: Sqr(Num)
Num - real an integer-is tipis gamosaxulebaa. Ffunqcia
Sqr gvaZlevs Num-is kvadratSi ayvanis Sedegad miRebul
mniSvnelobas.
Mmag: Sqr(2)=4
Sqr(2.0)=4.0
F
funqcia Sqrt
sintaqsi: Sqrt(Num)
Num - real an integer-is tipis gamosaxulebaa. Ffunqcia
Sqrt gvaZlevs Num-dan kvadratuli fesvis mniSvnelobas.
Mmag. Sqrt(4)=2
Sqrt(4.0)=4.0
Ggardaqmnis funqciebi
F
funqcia Odd
sintaqsi: Odd(Num)
Num mTeli ti pis gamosaxulebaa. Ffunqcia Odd
gvaZlevs Boolean ti pis mniSvnelobas, Tu Num aris kenti
ricxvi, maSin funqciis mniSvneloba aris True, winaaRmdeg
SemTxvevaSi false.
Mmag: Odd(3)=true
Odd(4)=false
92
Ffunqcia Pred
sintaqsi: Pred(Num)
Num nebismieri martivi ti pis gamosaxulebaa.
Ffunqcia Pred gvaZlevs Num-is wina mniSvnelobas.
Mmag: Pred(‘b’)=’a’
Pred(-20)=-21
funqcia Succ
sintaqsi : Succ(Num)
Num nebismieri martivi ti pis gamosaxulebaa.
Ffunqcia Succ gvaZlevs Num-is momdevno mniSvnelobas.
Mmag: Succ(false)=true
Succ(0)=1
F
funqcia Chr
sintaqsi: Chr(Num)
Num mTeli ti pis gamosaxulebaa. Ffunqcia Chr
gvaZlevs Char tipis gamosaxulebas, romlis kodi mocemulia
Num gamosaxulebiT.
Mmag: Chr(65)=’A’
Chr(27)=^[
funqcia Ord
sintaqsi: Ord(Num)
Num nebismieri martivi ti pis gamosaxulebaa.
Ffunqcia Ord gvaZlevs Num sididis ricxviT mniSvnelobas.
Mmag: Ord(true)=1
Ord(-2)=-2
Ffunqcia Round
sintaqsi: Round(Num)
Num - real ti pis gamosaxulebaa.
Ffunqcia Round amrgvalebs Num-s uaxloes mTel
93
ricxvamde.
mag: Round(5.5)=6
Round(-1.5)=-2
funqcia Trunc
sintaqsi: Trunc(Num)
Num - real ti pis gamosaxulebaa.
Ffunqcia Trunc gvaZlevs Num sididis mTel nawils,
e.i amrgvalebs Num ricxvs, mTeli nawilis CamoSorebis
xarjze.
Mmag: Trunc(3.14)=3
Trunc(-2.9)=-2
sxva funqciebi
funqcia Include
sintaqsi: Include(m, i) - m-s gazrdis i erTeuliT.
mag. Include (m, 2) - eqvivalenturia m := m + 2
Canawerisa.
funqcia Exclude
saintaqsi: Exclude(m, i) - m-s Seamcirebs i erTeuliT.
M mag. Exclude(m, 2) - eqvivalenturia m := m - 2
Canawerisa.
grafikis safuZvlebi
teqsturi da grafikuli reJimebi
94
striqonad, TiToeul striqonSi aris 40 an 80 pozicia. am
poziciebze SeiZleba ganaTdes ASCI I kodis simboloebi.
Ggrafikul reJimSi monitoris ekrani dayofilia
wertilebad. ekrani Sesdgeba 200 xazisagan. TiTo
xazSi SeiZleba iyos 320 an 640 wertili.
teqstur da grafikul reJimebSi aris feris Secvlis
saSualeba.
Fferebis konstantebi:
Const
95
procedurebi da funqciebi teqsturi
reJimisaTvis
96
gadaadgildeba ekranis zeda marcxena kuTxeSi.
Pprocedura ClrEol - asufTavebs yvela simbolos
dawyebuli kursoris poziciidan striqonis bolomde,
kursoris gadauadgileblad.
Pprocedura ClrScr-asufTavebs ekrans da moaTavsebs
kursors marcxena zeda kuTxeSi.
Pprocedura DelLine –waSlis striqons, romelzedac
imyofeba kursori da yvela danarCen striqonebs
gadaaadgilebs erTi striqoniT zemoT. Qqveda striqoni
sufTavdeba.
P p r o c e d u r a GotoXY a s r u l e b s k u r s o r i s
pozicionirebas, X-horizontaluri poziciaa, Y-vertikaluri
poziciaa.
Pprocedura InsLine Casvams cariel striqons
kursoris mdebareobis adgilas.
procedura TextBackground irCevs fonis fers.
procedura TextColor irCevs simbolos fers.
funqcia WhereX -kursoris mimdinare poziciisaTvis
(romelic ekuTvnis mimdinare fanjaras) iZleva X
koordinatas. X warmoadgens horizontalur
pozicias.Ffunqcia WhereY - kursoris mimdinare
poziciisaTvis (romelic ekuTvnis mimdinare fanjaras),
iZleva Y koordinatas. Y warmoadgens vertikalur
pozicias.Pprocedura Window ekranze gansazRvravs teqstur
fanjaras.
97
ekranze. Ee.i. ekranad igulisxmeba mocemuli fanjara. Aam
dros ekranis sxva danarCeni nawili xeluxlebelia. sxva
sityvebiT rom vTqvaT, ekranis sxva nawilSi mimarTva ar
xdeba. Ffanjris SigniT SeiZleba davamatoT da wavSaloT
striqoni, am dros kursori brundeba marjvena kuTxeSi da
kursoriT bolo striqonamde miRwevisas teqsti
gadaadgildeba zemoT.
Eekranis yvela koordinata, imaT garda, romlebic
gamoiyenebian fanjris gansazRvrisaTvis, miekuTvnebian
mimdinare fanjaras ekranis koordinata (1, 1) Seesabameba
ekranis zeda marcxena kuTxes (dumiliT, fanjrad iTvleba
mTeli ekrani)
m o d u l i Graph 5 0 - z e m e t i g r a f i k u l i
programebidan, realizacias ukeTebs mTel biblioTekas,
dawyebuli maRali donis funqciebisa da procedurebis
gamoZaxebiT, rogoricaa mag:
SetViewPort, Bar3D, DrowPoly, d a m T a v r e b u l i
programebiT, romlebic orientirebulia bitebTan muSaobaze.
Mmag: rogoricaa GGetImage an PutImage. reJims aqvs sxvadasxva
Sefardeba, xazis ti pebi da sxvadasxva Sriftebi, romlebic
SeiZleba Seicvalos sididiT, orientirebul iqnas
horizontalurad da vertikalurad.
SeTanxmebiT ekranis zeda marcxena kuTxes aqvs
koordinata (0,0) marjvniv gadaadgilebisas X koordinata
imatebs, xolo Y imatebs qvemoT gadaadgilebiT.
moviyvanoT magaliTi, romelic uCvenebs Tu rogor
unda gadavideT grafikuli reJimidan teqsturSi da piriqiT:
98
1. Program GraphTest;
2. Uses
3. Graph;
4. Var
5. GraphDriver : Integer;
6. GraphMode : Integer;
7. ErrorCode : Integer;
8. begin
9. GraphDriver : = Detect; {grafikuli reJimis
amocnobis droSis dayeneba}
10. InitGraph (GraphDriver, GraphMode, ‘c:\Drivers’);
{grafikuli reJimis inicializacia anu
sawyisi pirobebis momzadeba}
11. ErrorCode: = GraphResult;
12. If ErrorCode < > grOK then { Secdomaa}
13. Begin
14. Writeln(‘grafikis Secdomaa:’,
GraphErrorMsg(ErrorCode);
15. Writeln (‘programam avariulad daasrula
muSaoba’);
16. Halt (1); {aCerebs programis Sesrulebas da marTvas
gadascems operaciul sistemas}
17. End;
18. OutText (‘grafikuli reJimi. daaWireT <Enter>-s’);
19. Readln;
20. Restore CrtMode;
21. Write (‘teqsturi reJimia. daaWireT <Enter>-s’);
22. Readln;
23. SetGraphMode (GraphMode); {grafikul reJimSi
gadasvla}
24. OutText (‘kvlav grafikuli reJimia. daaWireT
<Enter>-s’);
25. Readln;
99
26. CloseGraph; {grafikuli reJimis daxurva}
27. End. {GraphTest}
100
sintaqsi:
Ellipse (x, y : integer; sawyisi kuTxe, saboloo kuTxe: Word;
radiusi X, radiusi Y : word);
(x, y) - elifsis centris koordinatebia.
radiusi X da radiusi Y-Hhorizontaluri da vertikaluri
RerZebia.
101
reJims.
102
procedura PutPixel - agebs gamosaxvis elements
(wertils), x, y wertilSi.
sintaqsi:
PutPixel (X,Y : integer; feri : Word);
X, Y - wertils koordinatebia.
feri - wertilis feria.
p r o c e d u r a Rectangle - x a t a v s m a r T k u T x e d s
(sworkuTxeds) mimdinare ferisa da xazis tipis gamoyenebiT.
sintaqsi:
Rectangle (X1, Y1, X2, Y2 : integer);
X1, Y1 - zeda marcxena kuTxis koordinatebia;
X2, Y2 - qveda marjvena kuTxis koordinatebia;
103
grafikul reJimSi da wmends ekrans.
xazis ti pebi:
Solidln = 0; {uwyveti xazi}
Dottedln = 1; {xazi wertilebisgan}
Centerln = 2; {xazi wertilisa da tiresagan}
Dashedln = 3; {punqtiris xazi}
VserDilhn = 4; {momxmareblis mier SerCeuli ti pi}
funqcia TextHeight - gvaZlevs striqonis simaRles.
sintaqsi: TextHeight ( teqsti-striqoni: string) gamoiyeneba
striqonebs Soris intervalis gansazRvrisaTvis.
funqcia: TextWidth gvaZlevs striqonis siganes gamosaxvis
elementebSi.
sintaqsi: TextWidth (teqsti-striqoni: string); es sasargebloa
gamoviyenoT striqonebs Soris intervalis gamoTvlisas.
xmovani signali
104
Num - mTeli ti pis gamosaxulebaa. Sound proceduriT
miiReba monotonuri xmis signali Num herci sixSiris.
procedura: NoSound
sintaqsi: NoSound
105
programas, turbo paskalis teqsturi reJimis gamoyenebiT,
gamoaqvs teqsti ekranis sxvadasxva adgilas, fonisa da
simboloebis feris SerCeviT.
U
Uses
crt;
begin
Clrscr;
Textcolor (Red);
Textbackground (Green);
Writeln (‘Izabela’);
GotoXY(5, 10);
Textcolor (Magenta);
Textbackground (Blue);
Writeln (‘Justina’);
GotoXY(10, 20);
Textcolor (Yellow);
Textbackground (red);
Writeln (‘Meison’);
Readln;
end.
106
programa teqstur reJimSi xsnis fanjaras:
Uses
Crt;
Var
K : Integer;
begin
Textbackground (Blue);
Window (5, 2, 35, 17);
Textcolor (Yellow);
For K := 1 To 100 Do
Write (‘Press....enter.....’);
Readln;
Clrscr;
Textbackground (Red);
Textcolor (White);
Window (40, 2, 70, 17);
For K := 1 To 100 Do
Write(‘Press...enter...’);
Readln;
end.
107
programa agebs naxazs grafikuli reJimis gamoyenebiT:
Program GraphDemo;
Uses
Crt, Graph;
Var
i, j, k, Graphdriver, GraphMode : Integer;
Xa, Ya : Word;
begin
Clrscr;
GraphDriver := detect;
InitGraph (GraphDriver, GraphMode, ‘’);
For i := 1 To GetmaxX Do For j := 1 To
GetmaxY Do
Putpixel (i, j, 5);
Setcolor (4);
SetlineStyle (SolidLn, 0, thickwidth);
For i := 1 To 200 Do
Circle(GetmaxX div 2, GetmaxY div 2, i);
Setcolor(10);
For i := 1 To 100 Do
Arc (GetmaxX div 2, GetmaxY div 2, 0, 90, i );
Rectangle (220, 230, 350, 360);
OuttextXY(465, 40, ‘aspect ratio’);
Getaspectratio(Xa, Ya);
Setbkcolor (11);
Setfillstyle (9, 11);
i := 0;
j := 0;
108
Repeat
Ellipse (i, j, 0, 360, 60, 40);
i := i + 20; j := j + 20 Until j = 300;
For k := 1 To 10 Do begin
Sound (100 * k +k * 200);
delay (500);
nosound; end;
Repeat until keypressed;
Closegraph;
end.
Program MusicDemo;
Var
I : Integer;
begin
For I := 1 To 10 Do begin
Sound (I * 200);
Delay (5000);
Nosound;
end;
109
DELPHI.
moduli.
unit SayStuff ;
begin
procedure SayHello ;
begin
Seiqmnas fanjara ;
davweroT fanjaraSi ~gamarjoba~;
gavanadguroT fanjara;
end ;
procedure SayBye ;
begin
Seiqmnas fanjara ;
davweroT fanjaraSi ~naxvamdis~;
gavanadguroT fanjara;
end ;
110
procedure SayNothing;
begin
Seiqmnas fanjara ;
davweroT fanjaraSi ~araferi~;
gavanadguroT fanjara;
end ;
end ; {moduli SayStuff}
erTaderTi rac gavakeTeT aris is rom sami
procedura movaTavseT erT jgufSi da davarqviT saerTo
saxeli – SayStyff. Tu Cven dagvWirdeba sxva proeqtSi
aRniSnuli procedurebis gamoyeneba, unda davweroT : Use
SayStyff .
modulis formati :
UUnit YourNameHere ;
interface
uses …
const…
type …
var …
procedure …
function …
implementation
uses …
Label …
const …
type …
var …
procedure …
function …
111
initialization {araaucilebeli ganyofileba}
begin
…..
end ;
112
daniSnuleba. igi saSualebas iZleva daixuros failebi,
ganTavisufldes mexsiereba da Catardes sxva damasrulebeli
operaciebi. finalization ganyofileba sruldeba ukumimdevrobiT
initialization ganyofilebasTan damokidebulebaSi. magaliTad,
Tu inicializacia gaukeTda modulebs Semdegi mimdevrobiT :
X, Y, Z, maSin isini daixurebianN Semdegi mimdevrobiT : Z,
Y, X.
qvemoT moyvanilia moduli, romelic saWiroa Seiqmnas,
raTa Sesruldes ramdenime martivi maTematikuri funqcia.
Unit MatsStuff ;
Interface
Function AddTwoNumbers (One, Two : Integer) : Integer ;
Function SubtractTwoNumbers (One, Two : Integer) :
Integer ;
Function SubtractTwoNumbers (One Two, : Integer) :
Integer ;
Procedure PositiveKarma ;
implementation
Function AddTwoNumbers (One, Two : Integer) : Integer ;
begin
AddTwoNumbers := One + Two ;
end ;
Function SubtractTwoNumbers (One, Two : Integer) :
Integer ;
begin
SubtractTwoNumbers := One – Two ;
end ;
Function SubtractTwoNumbers (One, Two : Integer) :
Integer ;
begin
SubtractTwoNumbers := One – Two ;
113
end ;
procedure PositiveKarma ;
begin
Writeln (‘Tqven SegiZliaT amis gakeTeba,
maTematika ar aris rTuli’) ;
end ;
end. {MathStuff Unit}
interface nawilSi Cven ganvsazRvreT is funqciebi da
procedurebi, romlebic mocemuli modulis
momxmareblisaTvis aris misawvdomi. implementation nawilSi
Cven SevqmeniT is, rac gamovacxadeT interface nawilSi.
procedura PositiveKarma dawerilia maTTvis, visac ar uyvars
maTematika.
dawerili modulis gamoZaxebisaTvis, igi ubralod
unda CairTos ZiriTadi programis Uses winadadebaSi.
modulis gamoyeneba :
Program MathDemo ;
uses
MathStuff ;
var
A, B : Integer ;
begin
A := 1 ;
B := 2 ;
Writeln (‘A da B – s jami tolia’ AddTwoNumbers
(A,B)) ;
Writeln (‘ programis dasrulebisaTvis daaWireT
enter – s’) ;
Readln {enter – is daWeramde fanjara rom Ria
darCes} ;
end. {MathDemo}
es programa MathStuff modulis mxolod erT
114
funqcias oyenebs, es aris – AddTwoNumbers. aRniSnuli
modulis Cvens proeqtSi Casamateblad saWiroa Sesruldes
Semdegi brZaneba : View -> Project Manager da vaWerT Add
Rilaks.
forma
1. gavuSvaT delfi ;
2. davinaxavT cariel formas, romelic
115
dasaTaurebulia FORM1 – iT , Tu es ar
Sesrulda, avirCioT meniuSi : File -> New
Application ;
3. avirCioT komponentebis palitraze (romelic
ganTavsebulia ekranis zeda marjvena kuTxeSi)
Standart gverdi;
4. davawkapunoT Button Rilakis niSanze ;
5. davawkapunoT formis SuaSi, am adgilas gaCndeba
Rilaki ;
6. orjer davawkapunoT am Rilakze ; gamoCndeba
programuli fanjara, sadac kursori
ganTavsebulia begin da end striqonebs
Soris ;
7. davweroT striqoni :
Canvas.TextOut (20, 20, ‘ programireba delfSi
Zalian martivia’) ;
8. Cven SevqmeniT Cveni pirveli danarTi,
kompilaciisa da SesrulebisaTvis vaWerT F9
Rilaks an avirCioT meniuSi : Run -> Run.
116
formas aqvs igive Tvisebebi, rogorc Windows – is
yvela fanjaras. igi Semdegnairad gamoiyureba :
117
programis Sesrulebaze gaSvebis Semdeg danarTi Semdeg
saxes miiRebs:
118
komponentebis palitra
119
obieqtebis inspeqtori.
120
magaliTad Tu movniSneT forma, obieqtebis inspeqtorSi
davinaxavT Font Tvisebas da plus niSans mis Semdeg. Tu
orjer davawkapunebT Font (Srifti) Tvisebaze, maSin gaixsneba
iseTi Tvisebebis cxrili rogoricaa Color (feri), Height
(simaRle), Name (saxeli) da a. S. aseTi formati xilvadi,
martivi da efeqturia obieqtis atributebis Secvlisas.
121
xdomilobebis gverdi.
122
Delphi - s menius struqtura.
meniu File
New
New Application
New Form
123
axali modulis Seqmna.
Open
ReOpen
Save
Save As
Save Project As
Save All
Close
124
Senaxvas.
Use Unit
am punqtis arCeva mimdinare modulis kodSi Casvams
Uses operators im modulisaTvis, romelic gvinda
gamoviyenoT.
Add To Project
Exit
gasvla Delphi-dan.
UnDelete/Undo
125
Tu bolo moqmedeba gavakeTeT kodis an komponentis damateba,
es punqti Undo-d gadaiqceva da gaauqmebs bolo damatebas.
Redo
Cut
Copy
Paste
Delete
Select All
Align to Grid
126
formaze ganTavsebul komponentebs gaasworebs badis
kuTxeebSi.
Bring To Front
Send To Back
Align
Size
Scale
Tab Order
127
brZanebas gamoaqvs fanjara, sadac CamoTvlilia
formaze ganTavsebuli komponentebis sia. SegviZlia
SevcvaloT maTi mimdevroba, risTvisac movniSnoT igi da
davaWiroT Rilaks ‚zemoT~ an ‚qvemoT~.
Creation Order
Lock Controls
Find
Find in Files
Replace
128
Search Again
Incremental Search
Go to Line Number
Find Error
Browse Symbol
Project Manager
Project Source
129
am brZanebas kodis redaqtoris fanjaraSi Seaqvs
proeqtis sawyisi faili.
Object Inspector
Alignment Palette
Browser
Breakpoints
Ccall Stack
Watches
130
gamosaxulebebs, romlebis Seicaven am cvladebs. aqve SeiZleba
ganisazRvros Tu rogori formatiT unda gamoisaxos
Sedegebi.
Threads
Modules
Component List
Window List
Toggle Form/Unit
Units
131
proeqtis yvela modulis sias. SegviZlia avirCioT
sasurveli.
Forms
SpeedBar
Component Palette
Add To Project
132
menius am punqtis arCeva saSualebas iZleva proeqtSi
davamatoT arsebuli moduli da masTan dakavSirebuli
forma. roca Cven vamatebT proeqtSi moduls, Delphi
avtomaturad daamatebs proeqtis failSi Sesabamis
operators Uses. mocemuli menius punqts igive funqcia
aqvs, rogorc File -> Add To Project brZanebas.
Remove To Project
Add To Repository
Compile
Build All
133
es programa kompilacias ukeTebs yvela komponents,
formas, moduls imisagan damoukideblad Seicvalnen Tu
ara isini.
Syntax Check
Information
Options
Run
Parameters
134
Step Over
Trace Info
Run To Cursor
135
kursori ganTavsebuli iqneba im operatorze, romelic
SemdgomSi Sesruldeba .
Program Pause
Program Reset
obieqtur-orientirebuli daproeqteba
136
obieqtebi
klasebi
Type
TForm1 = class(TForm)
public
{gamocxadebis gaxsna}
proteqted
{daculi gamocxadeba}
private
{daxuruli gamocxadeba}
end;
137
`gare samyarosaTvis~. private nawilSi gamocxadebulia
cvladebi, procedurebi, funqciebi, romelic gamoyenebulia,
mxolod klasis SigniT. protected nawili aris wina ori
ganxilulis saukeTeso Tvisebebis Serwyma. masSi
gamocxadebuli komponentebi misawvdomia mxolod
gamocxadebuli ti pis STamomavlobisaTvis.
SevqmnaT monacemebis sakuTari obieqti, sabanko baraTis
PIN kodis Sesanaxad. igi ase gamoiyureba:
Secret = class (TObject)
private
FThe_PIN : Integer;
end;
es kodi qmnis ara marto klass Secret saxeliT, aramed
daxurul FThe_PIN cvlads PIN mniSvnelobis Sesanaxad.
memkvidreobiToba
Delphi – is danarTi.
138
proeqtis faili (.dpr) es faili gamoiyeneba
formebisa da modulebis Sesaxeb informaciis Sesanaxad.
modulis faili (.pas) es faili gamoiyeneba kodis
Sesanaxad. zogierTi moduli dakavSirebulia formasTan,
zogierTSi inaxeba mxolod funqciebi da procedurebi.
formis faili (.dfm) es aris faili, romelSic
inaxeba informacia Cveni formebis Sesaxeb. TiToeuli formis
fails Seesabameba modulis faili (.pas) . magaliTad
myform.pas failisaTvis arsebobs masTan dakavSirebuli
faili myform.dfm.
proeqtis parametrebis faili (.dfo) - am failSi
inaxeba proeqtis parametrebis dayeneba.
paketebis Sesaxeb informaciis faili (.drf) -
es binaruli faili Delphi – Si gamoiyeneba paketebTan
muSaobisas.
resursebis faili (.res) - es binaruli faili
Seicavs proeqtis mier gamoyenebul piktogramas. es faili
ar unda Seiqmnas da Seicvalos momxmareblis mier, radganac
Delphi mudmivad ukeTebs modificirebas am fails.
sarezervo aslebis faili (.~dp, .~df,.~pa) - es
aris proeqtis failebis, formebisa da modulebisaTvis
sarezervo aslebis faili.
program Project1;
uses
Forms,
Unit1 in ‘UNIT1.PAS’ {Form 1};
{SR*.RES}
begin
Application.CreateForm(TForm, Form1);
Application.Run(Form1);
end.
moduli
140
da failebis Sesanaxad; programuli modulebis failebi,
romlebic gamoiyeneba komponentebis asagebad.
moduli es aris programuli kodebis faili, .pas
gafarToebiT.
ganvixiloT moduli, romelic Delphi-Si iqmneba
dumiliT :
unit Unit1 ;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics,
Controls, Forms, Dialogs ;
type
TForm1 = class(TForm)
procedure FormCreate (Sender: Tobject);
private
{private declarations – daxuruli gamocxadeba}
public
{public declarations – Ria gamocxadeba}
end;
var
Form1: TForm1;
implementation
{$R*.DFM}
141
end;
end.
proeqtis magaliTi
142
qvekatalogi. magaliTad : c:\program
files\borland\delphi 3.0\mysource.
2. SevqmnaT qvekatalogi, romelSic SevinaxavT Cvens
p r o e q t s , d a v a r q v a T Formtalk (c:\program
files\borland\delphi 3.0\mysource\formtalk)
3. gavuSvaT Delphi avirCioT brZaneba File| New,
avirCioT Application piktograma, New Items
dialogur fanjaraSi.
4. avirCioT brZaneba File|New Form, proeqtze meore
formis dasamateblad.
5. SevucvaloT Form1 formas da mis komponentebs
zogierTi Tviseba. obieqtebis inspeqtoris (Objec
Inspector) gamoyenebiT Cvens formas SevucvaloT
caption (saTauri) Tviseba da davarqvaT ‘Semavali
forma~, xolo formis name (formis saxeli)
Tvisebas davarqvaT `InputForm~ (formebisa da
komponentebis saxelebi iwereba laTinuri asoebiT,
radgan isini arian identifikatorebi.
6. obieqtebis inspeqtoris gamoyenebiT meore formas
SevucvaloT saTauri da davarqvaT `gamomavali
forma~, xolo name TvisebaSi avkrifoT
`OutputForm~. programis Sesrulebisas es forma
gamomaval monacemebs miiRebs `InputForm~- dan.
monacemebis gadagzavna moxdeba maTi Setanisa da
`gadagzavna~ Rilakis daWeris Semdeg.
7. SevinaxoT unit1.pas modulis faili, magram fails
SevucvaloT saxeli SemdegiT:
c:\program files\borland\delphi 3.0\mysource\formtalk\input.pas
Semdeg unda SevinaxoT unit2.pas SevcvaloT misi saxeli
da davarqvaT output.pas
proeqtis failis Sesanaxad gamoviyenoT brZaneba File|
Save Project As , gamosul fanjaraSi avirCioT katalogi
da saxeli proeqtis failis Sesanaxad. proeqtis
143
fails davarqvaT project1.dpr, misi misamarTi diskze
iqneba:
c:\programfiles\borland\delphi\mysource\formtalk\formtalk.dpr
144
4. isev gavuSvaT programa Sesrulebaze F9-iT. Cveni
formebi gamoCndeba ekranze.
5. gavukeToT programas testireba, SevitanoT teqsti
Semaval formaSi da davaWiroT `gadagzavna~ Rilaks.
Cveni Setanili teqsti gamoCndeba gamomavali
formis fanjaraSi.
program Formtalk ;
uses
Forms,
Input in ‘Input.pas’ {InputForm},
Output in ‘Output.pas’ {OutputForm};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TInputForm, InputForm);
Application.CreateForm(TOutputForm, OutputForm);
application.Run;
end.
uses operatori Seicavs Forms moduls da Input, Output
modulebs, romlebic Seicaven Cvens mier Seqmnili formebis
kodebs.
pirveli begin operatoris Semdeg vxedavT meTodebis
operatorebs: Application.Initialize da Application.createForm. es
meTodebi asruleben Cveni formebis Seqmnisa da gaSvebisaTvis
aucilebel operaciebs. meTodi Seicavs kodis fragments.
damasrulebeli operatori aris Application.Run. igi gauSvebs
145
Cvens danarTs da Seasrulebs Cvens formebTan dakavSirebul
kods. formis damatebis an amogdebisas Delphi avtomaturad
akeTebs proeqtis sawyisi kodis modificirebas.
vnaxoT Semavali formis modulis kodi, risTvisac
Semaval formaze orjer davawkapunoT.
Input formis moduli :
unit Input ;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, dialogs,
StdCtrls ;
type
TInputForm = class(TForm)
SendText: TButton;
InText: Tedit;
procedure SendTextClick(Sender: Tobject);
private
{private declarations}
public
{public declarations}
end;
var
InputForm: TInputForm;
implementation
uses output;
{$R *.DFM}
146
procedure TInputForm.SendTextClick(Sender: TObject);
begin
OutputForm.OutText.Text := InputForm.InText.Text;
end;
end.
unit Output ;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms,
dialogs,
StdCtrls ;
type
TOutputForm = class(TForm)
OutText: TEdit;
InText: TEdit;
private
{private declarations}
public
{public declarations}
end;
var
OutputForm: TOutputForm;
147
implementation
{$R *.DFM}
end.
redaqtoris gamoyeneba
148
obieqtebis inspeqtoris fanjaraSi Caption Tvisebas
mivceT mniSvneloba `Sekreba~.
4. igive teqnikis gamoyenebiT formaze ganvaTavsoT
ori Wde (Label) da ori redaqtirebis fanjara
(Edit). Wdis piktogramaze gamosaxulia ~A’’
simbolo. ganvaTavsoT es obieqtebi vertikalurad
Semdegi mimdevrobiT: Label1, Edit1, Label2, Edit2.
149
kidev ori Wde, esenia Label1 da Label2 , romlebic
ganTavsebulia erTmaneTis gverdiT. Label3 Wdis
Caption Tvisebas mivaniWoT `jami~ mniSvneloba,
xolo Label4 Wdis Caption Tvisebas wavuSaloT
dumiliT micemuli mniSvneloba..
8. gamoviZaxoT kodis redaqtori, risTvisac Rilakze
orjer davawkapunoT.
9. Button1-saTvis CavsvaT saWiro kodi. gavakeToT
kodis redaqtireba ise, rom miviRoT Semdegi teqsti:
unit addform;
interface
150
uses
type
TForm1 = class (TForm)
Button1 : TButton;
Edit1 : TEdit;
Edit2 : TEdit;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
procedure ButtonClick (Sender : TObject);
private
{ private declarations}
public
{ public declarations}
end;
var
Form1 : TForm1;
implementation;
{$r * . DFM}
151
Value2 := StrToInt (Edit2.Text);
Label4.Caption := IntToStr (Value1 + Value2);
end;
end.
152
komponentebis Tvisebebi
153
Height
Name
Pitch
Size
+Style
fsBold
fsItalic
fsUnderline
fsStrikeOut
Height
HeipContext
Hint
Left
ModalResult
Name
ParentFont
ParentChowHint
PopupMenu
ShowHint
TabOrder
TabStop
Tag
Top
Visible
Width
zogierTi Tviseba damokidebulia sxva Tvisebaze.
magaliTad Hint (miTiTeba). es miTiTeba gamodis maSin, rodesac
kursori miuaxlovdeba komponents. es imuSavebs mxolod
maSin, Tu ShowHint TvisebaSi arCeulia True mniSvneloba.
Tu TvisebaSi ParentShowHint (gamoviyenoT mSoblis ShowHint)
arCeulia True mniSvneloba, miTiTeba gamova mxolod mSobel
formaze, xolo Tu misi mniSvnelobaa False es miTiTeba
gavrceldeba Svili formebisaTvisac. aseve Tu ParentFont
154
(gamoviyenoT mSoblis Srifti) TvisebaSi dayenebulia True,
komponenti miiRebs informacias Sriftis Sesaxeb mSobeli
formisagan.
xdomilobebi.
meTodebi.
155
ScreenToClient
ScrollBy
SendToBack
SetBounds
SetFocus
SetTextBuf
Show
Update
meTodis Sesaxeb informaciis misaRebad saWiroa
davawkapunoT komponenteze da davaWiroT F1 Rilakze.
miviRebT cnobebs aRniSnuli komponentis Sesaxeb. avirCioT
Methods da gamoCndeba mocemuli komponentisaTvis misawvdomi
sia. erT-erTis arCeva iZleva imis ganmartebas Tu rogor
muSaobs igi da rogor visargebloT am meTodiT.
156
Memo komponenti (redaqtirebis mravalstri-
qoniani fanjara), gamoiyeneba mravalstriqoniani teqstis
Sesatanad. komponenti vizualuria.
komponenti Button (brZanebis Rilaki), gamoiyeneba
Rilakis Sesaqmnelad, romliTac momxmarebeli danarTisaTvis
irCevs brZanebas. komponenti vizualuria.
CheckBox komponenti (sakontrolo indikatori
droSiT) momxmarebels programis opciis amorCevis an
gamorTvis saSualebas aZlevs. komponenti vizualuria.
RadioButton komponenti (radioRilaki) momxmarebels
aZlevs alternativebis nakrebs, saidanac amoirCeva erTi.
komponenti vizualuria.
157
RadioGroup komponenti (radioRilakebis jgufi)
warmoadgens GroupBox-is fanjarasradioRilakebis nakrebiT.
emsaxureba radioRilakebis jgufis Seqmnas. komponenti
vizualuria.
159
fname, InString : string;
begin
{cvlads mivceT teqsturi failis saxeli}
fname := ‘JUNKFILE.TXT’;
{ganvsazRvroT teqsturi faili, rogorc InFile}
AssignFile (InFile, fname);
{gavxsnaT InFile faili}
Reset (InFile);
{wavikiTxoT teqstis striqoni}
Readln (InFile, InString);
{wakiTxuli striqoni movaTavsoT Read Text
fanjaraSi}
Edit2.Text := InString;
{davxuroT faili}
CloseFile (InFile);
end;
unit Textform;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs,
160
StdCtrls;
type
TForm1 = class(TForm)
Edit1 : TEdit;
Label1 : TLabel;
Label2 : TLabel;
Edit2 : TEdit;
Button1 : TButton;
Button2 : TButton;
Button3 : TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
161
AssignFile(OutFile,fname);
Rewrite(OutFile);
OutString:=Edit1.Text;
Writeln(OutFile,OutString);
CloseFile(OutFile);
end;
end.
ti pizebuli faili
162
qvemoT movaTavsoT Semdegi kodi:
type
Address = record
Lastname : String[20];
Firstname : String[20];
Phone : String[15];
StreetAddress : String[50];
City : String[40];
State : String[2];
ZipCode : String[10];
end;
AssignFile
Reset
163
sintaqsi: procedure Reset (var F: File; [RecSize: Word] );
daniSnuleba: gamoiyeneba arsebuli failis
gasaxsnelad. im failisa, romlis saxeli mieniWa failur
cvlads AssignFile – is daxmarebiT.
Rewrite
Seek
Read
Write
Eof
164
daniSnuleba: gamoiyeneba failis dasasrulis
aRniSvnisaTvis.
CloseFile
proeqtis magaliTi.
Fname : String;
RecSize, CurRec : Longint;
165
ganvixiloT kodi da gamoviyenoT igi Sesabamis marTvis
elementebze dasamateblad.
`misamarTebisa da telefonebis~ wignis danarTis
amonabeWdi:
Unit Addr;
interface
166
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons;
type
TForm1 = class (TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Previous: TButton;
Next: TButton;
Save: TButton;
New: TButton;
Close: TBitBtn;
procedure FormCreate (Sender : TObject);
procedure NewClick (Sender: TObject);
procedure previousClick(Sender : TObject);
procedure NextClick (Sender: TObject);
procedure SaveClick (Sender: TObject);
procedure CloseClick (Sender: TObject);
private
167
{private declarations}
procedure LoadRecord;
procedure SaveRecord;
procedure ShowRecord;
procedure ClearData;
public
{public declarations}
end;
var
Form1: TForm1;
implementation
{$R*.DFM}
type
Address = record
Lastname: String[20];
Firstname: String[20];
Phone: String[15];
StreetAddress: String[50];
City : String[40];
State : String[2];
ZipCode : String[10];
end;
Var
AddressFile : File of Address;
AddressData : Address;
Fname : String;
RecSize, CurRec : Longint;
procedure TForm1.LoadRecord;
begin
168
{Canaweris CatvirTva}
Read(AddressFile, AddressData);
{Canaweris gamosaxva ekranze}
ShowRecord;
end;
procedure TForm1.SaveRecord;
begin
{Canaweris kopireba ekranidan}
AddressData.Lastname := Edit1.Text;
AddressData.Firstname := Edit2.Text;
AddressData.Phone := Edit3.Text;
AddressData.StreetAddress := Edit4.Text;
AddressData.City := Edit5.Text;
AddressData.State := Edit6.Text;
AddressData.ZipCode := Edit7.Text;
{movaTavsoT Canaweri failSi}
Write (AddressFile, AddressData);
end;
procedure TForm1.ClearData;
begin
{redaqtirebis fanjrebis gasufTaveba}
Edit1.Text := ‘ ‘;
Edit2.Text := ‘ ‘;
Edit3.Text := ‘ ‘;
Edit4.Text := ‘ ‘;
Edit5.Text := ‘ ‘;
Edit6.Text := ‘ ‘;
Edit7.Text := ‘ ‘;
end;
169
begin
{redaqtirebis fanjrebis gasufTaveba}
ClearData;
{Clear Current Record Counter}
CurRec := 0;
{davayenoT failis saxeli}
Fname := ‘ADDRESS.DAT’;
{davniSnoT failuri cvladi};
AssignFile (AddressFile, Fname);
{miviRoT Canaweris zoma}
RecSize := SizeOf (AddressData);
{Tu faili arsebobs, igi CavtvirToT}
If FileExists (Fname) then
Begin
Reset (AddressFile);
If not Eof (AddressFile) then
begin
Read (AddressFile, AddressData);
ShowRecord;
end;
end
170
CurRec := CurRec + 1;
Seek (AddressFile, CurRec);
until Eof (AddressFile);
{gavasufTaoT redaqtirebis fanjara}
ClearData;
{SevqmnaT axali Canaweri}
SaveRecord;
{failis maCvenebeli gadavaadgiloT mimdinare
Canawerze}
Seek (AddressFile, CurRec);
end;
171
procedure TForm1.NextClick (Sender: TObject);
begin
{gadavadgildeT Semdeg Canawerze}
CurRec := CurRec + 1;
Seek (AddressFile, CurRec);
{Tu ar aris failis dasasruli, wavikiTxoT da
gamovsaxoT Canaweri}
If not Eof (AddressFile) then
begin
Read (AddressFile, AddressData);
Seek (AddressFile, CurRec);
ShowRecord;
end
{Tu miRweulia failis dasasruli, davubrundeT bolo
Canawers da gamovceT Setyobineba)
else
begin
CurRec := CurRec – 1;
Seek (AddressFile, CurRec);
ShowMessage (‘es failis dasasrulia’);
end;
end;
172
Form1.Edit7.Text := AddressData.ZipCode;
end;
end.
173
exla SegviZlia danarTis testireba gavakeToT.
SevitanoT monacemebi da davaWiroT `Senaxva~ Rilaks, Semdegi
Canaweris Sesatanad vaWerT `axali~ Rilaks, redaqtirebis
fanjrebi gasufTavdeba da momzaddeba axali Canaweris
Sesatanad. danarTis momdevno gaSvebisas danarTi TiTon
i povis ADDRESS.DAT fails da gamoitans mis pirvel
Canawers ekranze.
174
unit gilakebi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms,
Dialogs, Menus, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
RadioGroup1: TRadioGroup;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
ComboBox1: TComboBox;
Button1: TButton;
MainMenu1: TMainMenu;
N1: TMenuItem;
File1: TMenuItem;
procedure RadioGroup1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure File1Click(Sender: TObject);
private
{ Private declarations }
175
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
176
form1.Font.Style:=[];
end;
177
procedure TForm1.File1Click(Sender: TObject);
begin
application.Terminate;
end;
end.
178
grafikuli elementebi
179
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
const
pi=3.14159;
180
var
X : real;
Y : real;
PX : longint;
PY : longint;
HalfHeight : Longint;
begin
HalfHeight := form1.Height div 2;
for PX := 0 to form1.Width do
begin
X := PX*(2*PI/Form1.Width);
Y := sin(X);
PY := trunc(0.7 * Y * Halfheight) + HalfHeight;
Canvas.Pixels[PX,PY] := 0;
end;
end;
end.
181
wrfeebis daxazva.
182
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
const
Pi=3.14159;
183
var
X : real;
Y : real;
PX : Longint;
PY : Longint;
Offset : Longint;
HalfHeight : Longint;
begin
HalfHeight := Form1.Height div 2;
for Offset := -10 To 10 do
begin
PX := 0;
While PX < Form1.Width do
BEGIN
X := PX * (2 * PI/Form1.Width);
Y := SIN(X);
PY := Trunc(0.7 * Y * HalfHeight) + HalfHeight
+(Offset*10);
IF (PX = 0) Then
canvas.LineTo(PX, PY);
PY := trunc(0.7 * Y * HalfHeight) + HalfHeight +
((Offset-1) * 10);
canvas.LineTo(PX,PY);
PX := PX + 15;
end;
end;
184
martivi animacia Mode Tvisebis gamoyenebiT.
185
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1 : TButton;
procedure Button1Click(Sender : TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
begin
186
form1.Canvas.Pen.Mode := pmcopy;
form1.Canvas.Pen.Color := clRed;
form1.Canvas.PolyLine([point(50,10),
point(100, 10),
point(100, 200),
point(50, 200),
point(50, 10)]);
form1.Canvas.Pen.Color := clBlue;
form1.Canvas.Pen.Mode := pmNotXor;
For count := 0 to (form1.Width div 5) do
begin
Form1.Canvas.Polyline([point(Count * 5, 100),
point(Count * 5 + 10, 100),
point(Count * 5 + 5, 110),
point(Count * 5, 100)]);
Pause := Time;
while (Time-Pause) < 1e-12 do;
Form1.Canvas.Polyline([point(Count * 5, 100),
point(Count * 5 + 10, 100),
point(Count * 5 + 5, 110),
point(Count * 5, 100)]);
end;
end;
end.
187
ganvixiloT magaliTi.
danarTi, romelic `probelebs~ gardaqmnis
` mZimeebad~.
unit Sp2cma;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, dialogs, Menus, StdCtrls;
Type
TForm1 = Class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
OpenDialog1: TOpenDialog;
Edit1: TEdit;
Label1: Tlabel;
procedure Butto2Click (Sender: Tobject);
procedure Butto1Click (Sender: Tobject);
procedure Butto3Click (Sender: Tobject);
private
{private declarations}
public
{public declarations}
end;
var
Form1: TForm1;
implementation
188
var
Fname: String;
{SR * DFM}
var
InFile: File;
FBuffer : Array [0..1023] of Byte;
FPointer : Longint;
ButesRead : Integer;
X: Integer;
begin
AssignFile(InFile,Fname); Reset(InFile,1);
While Not Eof (InFile) do begin
FPointer := FilePos(InFile);
BlockRead (InFile, FBuffer, SizeOf(FBuffer), BytesRead);
For x:=0 to BytesRead-1 do begin
If FBuffer[x]=32 then Fbuffer[x] := 44;
end;
Seek(InFile, FPointer);
BlockWrite(InFile, FBuffer, BytesRead);
end;
CloseFile(InFile);
ShowMessage( ‘procesi dasrulebulia!’);
end;
189
procedure TForm1.Button1Click(Sender: TObject);
begin
OpenDialog1.FileName:=’*.*’;
if OpenDialog1.Execute then
Fname:= OpenDialog1.FileName;
Edit1.Text:=Fname;
Edit1.Visible:=True;
Label1.Visible:=True;
end;
begin
Application.Terminate;
end;
end.
190
sarCevi
Turbo Pascal
Sesavali ............................................................................................................................... 3
funqcionaluri Rilakebi ......................................................................................... 4
pirveli programa .......................................................................................................... 4
monacemTa ti pebi ............................................................................................................ 9
monacemTa ti pebis gardaqmna da maTze moqmedebebi ................................... 12
Sedgenili da carieli operatori ................................................................... 15
pirobis operatori ...................................................................................................... 21
FOR – TO cikli ............................................................................................................ 26
WHILE – DO cikli ..................................................................................................... 29
REPEAT – UNTIL cikli ............................................................................................. 31
amorCevis operatori ................................................................................................. 34
Wde da gadasvlis operatori .............................................................................. 39
masivis ti pi .................................................................................................................... 41
simravlis ti pi ............................................................................................................ 46
striqonuli ti pi ....................................................................................................... 50
Object Pascal
Canawerebi .......................................................................................................................... 56
ti pizebuli mudmiva .................................................................................................. 64
CamoTvliTi ti pi ......................................................................................................... 65
variantis ti pi ............................................................................................................. 66
191
ganStoeba......................................................................................................67
Goto...................................................................................68
Break..............................................................................69
Continue..........................................................................70
Exit..................................................................................71
Halt..................................................................................72
RunError..........................................................................72
failis ti pi..............................................................................................73
procedurebi da funqciebi failebTan muSaobisaTvis.......75
procedurebi da funqciebi teqsturi failebisaTvis78
procedurebi da funqciebi ti pizebuli da arati pize-
buli failebis damuSavebisaTvis....................................................82
procedurebi..............................................................................................83
funqciebi......................................................................................................87
standartuli qveprogramebi...........................................................89
ariTmetikuli funqciebi...................................................................90
gardaqmnis funqciebi............................................................................92
sxva funqciebi..........................................................................................94
teqsturi da grafikuli reJimebi.............................................96
Delphi
moduli........................................................................................................110
formebi........................................................................................................115
formebisa da komponentebis Tvisebebi ..............................115
Delphi-is martivi danari.................................................................115
kodis redaqtoris fanjara.........................................................119
obieqtebis inspeqtori....................................................................120
Delphi-is menius struqtura........................................................123
obieqtur-orientirebuli daproeqteba...............................136
Delphi-is danarTi..................................................................................138
proeqtis magaliTi.............................................................................142
192
redaqtoris gamoyenebis magaliTi..............................................148
programis marTvis damatebiTi brZanebebi...........................152
komponentebis Tvisebebi.....................................................................153
xdomilobebi...............................................................................................155
meTodebi.........................................................................................................155
komponentebis gverdi standartuli........................................156
teqsturi failis demonstrirebis magaliTi...................158
ti pizebuli faili................................................................................162
proeqtis magaliTi................................................................................165
grafikuli elementebi delfSi..................................................179
193
literatura
194
195
196