You are on page 1of 242

22-0204 ANAPTIXI EFARMOGON TETRADIO.

indb 1

7/7/2013 5:19:51

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 2

7/7/2013 5:19:51

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 3

7/7/2013 5:19:51


 ,

 ,

 ,

/ , M.Sc. ,

 ,

 , . ,
19

 ,
.. ( )

/ , 19
, 19

 ,

/ ,

 ,


-
-

 ,
49, 106 82, , . 38.45.594

 /
(),
16, , .: 3645274,
e.mail: epy@epy.gr



. , ..

. , ..

1.1.:
 . ,
,
No 15: /

 ,

 I. ,



&
, /
& / .
.

22-0204 ANAPTIXI EFARMOGON TETRADIO 001-144.indd 4

2/24/14 11:49 AM

. , . , . , . ,
. , . , .





( )

22-0204 ANAPTIXI EFARMOGON TETRADIO 001-144.indd 5

2/24/14 11:49 AM

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 6

7/7/2013 5:19:51

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.

.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.

. . . . . . . . . . . . . . . . . . . . . . . 29

4.

. . . . . . . . . . . . . . . . . . . . . . . . 37

5.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

6.

.. . . . . . . . . . . . . . . . . . . . . . . 55

7.

. . . . . . . . . . . . . . . . . . . . . 59

8.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
11. . . . . . . . . . . . 109
12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
13. . . . . . . . . . . . . . . . . . . . . . . . . 149
14. - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Turbo Pascal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Quick Basic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Visual Basic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Delphi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
. . . . . . . . . . . . . . . . . . . . . 233

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 7

7/7/2013 5:19:51

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 8

7/7/2013 5:19:51

,
, ,
.
. :
l

. ,
,
. ,
,
.
, , , QuickBasic, Turbo Pascal, Visual Basic Delphi.
.
, , , .
, .
:
l


, , ,
, , , , ,
,
,

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 9

7/7/2013 5:19:51

,
.


. ,
:
QQ

QQQ

Turbo Pascal Delphi


,
.
, ,

,
.
,
.

10

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 10

7/7/2013 5:19:51

1.1.

.
.
.
,
,

.
. ,
.

1.2.
1
1.4 , .
:

1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 11

11

7/7/2013 5:19:51

1999/2000 .
, () , ()
.

1.1.

. 1.1.

. .
.
, .
.
.
. ( . 1.4 ), .

.
. ,
.
:

, .
9
1, 10 13 2, ...

1/*100.
S .
:

S
N

S2 .
:

2 =

S2
2
N

.
, 5.

12

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 12

7/7/2013 5:19:51

1.3. -

. , ,
.

.
. ,

.

.
,
, .
,
,
.

1.4. -

27%

61%

12%

65%

32%

3%

(,
..) / ;

89%

7%

4%

1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 13

1. SOS , ,
. ,
,
. 3
, .
:

13

7/7/2013 5:19:51

, . .

. , , 15 .

)
.
.
 )
.
2. .


,
.
.
3.
.
. ,
.
)
, ) .
4.
.
. . , ,
.
5.
.
.
:
.
.
,
.
6. : .

14

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 14

7/7/2013 5:19:51

.
.
.

1. ,
. , , .
(, ,
..), (, , ..), (, ,
, ..), (, , ..) ( ,
..). .
2. , , . ; ;
, ,
.
.
3.

. , ,
/.
;

.
4.
.
.
5.
( ) 1.4
.

1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 15

15

7/7/2013 5:19:51

1.5.
1.

. ,
:
1. , , ( )
2. , , , ( )

2.

:
3.  ________________ .
4. ________________ .
5.  __________.
6.  ________________
.
7.  ________________.

3.

:
8. .
9. .
10. .
11. .
12. .

16

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 16

7/7/2013 5:19:52

2.1.
, . .

. . ,
.

2.2.
1.
:
5(F 32)
C=
9
C F .
.

2.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 17

17

7/7/2013 5:19:52

farenheit
celsius (farenheit-32) * 5 / 9
celsius

2.

,
.
, . ,
,
.

aktina
emvadon 3.14 * aktina * aktina
plevra 2 * aktina
tetragwno plevra * plevra
diagwnios (2 * tetragwno)

emvadon, tetragwno, diagwnios


3.

. 30 .


. , , 0, , . , MAX 0,
,
.
, MAX
.

18

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 18

7/7/2013 5:19:52

_1
100
MAX -100
i 1 30

<
> MAX MAX
_
// , MAX//
_1

4.
.
, . ,
x2+x+=0,
. ,
.

_
a
_ a0
b
c
delta b*b-4*a*c
delta 0
solution1 (-b+Pi(delta))/(2*a)
solution2 (-b-(delta))/(2*a)
solution1,solution2
_

5.
3 /
. 200 .
.



1, 2, 3 .

2.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 19

19

7/7/2013 5:19:52

i1

i>200

s1, s2, s3

=1

=2

s1 s1 + 1

s2 s2 + 1

=3

s3 s3 + 1

ii+1

_
s1 0 s2 0 s3 0
i 1 200

_ = 2 s2 s2+l

= 1 s1 s1+1

_ = 3 s3 s3+l
_

// s1, s2, s3 //
_

20

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 20

7/7/2013 5:19:52

6.
:
3x + 2y 7z = 5
x, y, z 0 100. .
:

x 0 100
y 0 100
z 0 100

3*x+2*y-7*z=5 x,y,z
_
_
_

2.3. -
,
,
.
.
l


.
.

(.. 100
, 20 ..).
.

2.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 21

21

7/7/2013 5:19:52

2.4. -
1. :

T = 2

L
g

L g .
.
2. , :
1. 340,75 .
2. 550 .
3. T 280 .
4. 100 .
1025 , 2234
3459 .
3. :
1. 100 .
2. 
100 .
4. ; .
1. 100 .
2. .
3. 100 .
4. .
5. , 25 .
6. .
5. ,
.
, 0.35,
. , 0.17, .
6. 1%

22

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 22

7/7/2013 5:19:52

18.

.
7.
, SOS
UNICEF.

:

500

5%

4%

501 - 800

7,5%

6%

801 - 1100

9,5%

8%

1100

12%

11%


.
8. 10 10
() Internet

.

.
.
9. 3 .
1 , 2
3 .
.
10. 10
.
101,102, ..., 110.
.

.

2.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 23

23

7/7/2013 5:19:52

1. :

i1
s0

i>200

m>10

s m+s

ii+1


.
2. 6 .

. 295.600 . 256.000 .

:

_ = 1

1
_


6 .

24

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 24

7/7/2013 5:19:53

,
,
.
3. 5.000 .

.
1 =340,75 . , ,

.
4. :
_
x

x > 1

x
x x/2

x 3*x+1

// x //

x=13, x=9 x=22. ;


5. 5
.
5 .

.

: .

2.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 25

25

7/7/2013 5:19:53

6. 4 .

0,60

300ml

0,65

400ml

1,20

500ml

1,35

550ml


.
7.
. :


_ = _ 1+


100

2

5 6,5%.
5
.
.
8.
(9). 100 ,
.
9. ( )
3
. 5 .

.

26

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 26

7/7/2013 5:19:53

2.5.
1.

. , :
1.  (free text)
.
2.  (flow charts) .
3.  (coding)
.

2.

:
4.  _________________ ( )
, .
5.  _________________
.
6.  _________________
.
7.  _________________ .
8.  _________________ .

3.

:
9.  .
10. 
.
11. 
.
12. 

.

4.

:
13.  :

2.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 27

27

7/7/2013 5:19:53

14.  :

5.

) /

) -

:
15. :

16. :

) 4

) 2

) 4

) 2

17.  :

28

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 28

7/7/2013 5:19:53

3.1.
.
.
.

(, , , ).
. ,
.

3.2.
1.
200 . .

3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 29

29

7/7/2013 5:19:53

_
MIS[1]
MAX MIS[1]
i 2 200
MIS[i]
MIS[i] > MAX
MAX MIS[i]
_
_
// MAX//
_

( 3).


. ,

.

2.
n k
:
n
n!
=
k k!(n k)!

.
. , n!,
.

n
k
a (n)
b (k)
c (n-k)
combination a /(b*c)
combination


, .

30

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 30

7/7/2013 5:19:53

.
. ,
10 5,
9 (10!), 4+4
( 5!).
:
10! 10 9 8 7 6
=
5!5!
12345
. :
2
n
k
a 1
i n n-k+1 _ -1
a a*i
_
b (k)
combination a/b
combination
2

3.
35 .

.

.
_
S 0
i 1 105
[i]
S S+M[i]
_
MO S/105
// //
_

4.
5x5 .

, .

3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 31

31

7/7/2013 5:19:53

_
i 1 5

j 1 5

A[i,j], B[i,j]
C[i,j] A[i,j] + B[i,j]
_

// C //

5.
(sparse) . , . , , 80%
.
( ..).
.
. .
. , , , .
0

-3

12

4x5, ,
.
, <,,>. 18 6
. :
1

-3

12

, ,
. < ,
m> 3n
, n .

32

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 32

7/7/2013 5:19:53


// sparse, n //
flag 0
k 0
flag=0
i sparse[3*k+1]
j sparse[3*k+2]
Av i=L j=M
result sparse[3*k+3]
flag 1
_ i > L (i=L j > )
result 0
flag 1

k k+1
_
_
// result //

3.3. -

1. 300 1 300 .
.


.
2. 3.7 Q Q Q
.

.
:
( i 2 n)
i .
3. (Push) (Pop) Q Q .
.
100 .
4. __ (Enqueue) __
Q Q (Dequeue) . .
100 .

3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 33

33

7/7/2013 5:19:53

5.
Q Q .
.

.
6. 50 Q Q .
10 .

10
.

1. :

1,01

1,03

0,65

0,66

1,57

1,59

0,01

0,012

0,67

0,68

.
2. 5 5 .

.
3.
Q Q . : ,
.
.

. '
.
.

34

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 34

7/7/2013 5:19:53

4. CD CD
. CD
CD
1995.
5. Q Q .
, ;
.

3.4.
1.

. , :
1.  , .
2.  ,

(dynamic memory allocation).
3.  : , .

2.

:
4.  ______________
.
5.  ______________
.
6.  ______________ .
7.  : ______________
______________ .
8.  : ______________
______________
.
9.  ______________.

3.

:
10.  :
.

3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 35

35

7/7/2013 5:19:53

11.  :
.
12.  .
13.  ,
.
4.

:
14.  ( )
:

)
15. 
:

5.

:
16.  :

36

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 36

7/7/2013 5:19:53

4.1.
, .

. . ,
.

4.2.
1.

:
,
.
1000 .

4.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 37

37

7/7/2013 5:19:53

,
. 1000 .
,
.
,
. THL .
_
// THL//
i 1 1000
j i
k i+1 1000
THL[k] < THL[j]
j k
_
_
THL[i], THL[j]
_
// THL //
_




(selection sort).

,

.

2.
. .
.

50 .
.

, ( 4).

38

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 38

7/7/2013 5:19:53

. .
(.. / )
(boolean flags). found . found 0,
, 1,
. ,
,
50
.

_
// , //
low 0
high 50
found 0
low high
mid (low + high)/2
[mid] <
low mid+1
_ [mid] >
high mid-1

found 1
_
_
// found //
_

3.
50
.
.
_
// //
low1 [1]
pos 1
i 2 50
M[i] < low1
low1 M[i]
pos i
_
_
pos <> 1
low2 [1]

low2 [2]



.
.

4.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 39

39

7/7/2013 5:19:54

_
i 2 50
i <> pos [i] < low2
low2 M[i]
_
_
// low1 , low2 //
_

4.3. -

1.
3 .
.
2.
.
(.. )
.
.
3. :

QQQ

n x n 1 n2
,
, :
15

24

17

16

14

23

22

20

13

21

19

12

10

25

18

11

n=5,
65. n .
:
1 .
2, 3, 4, ... ..
.

, -

40

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 40

7/7/2013 5:19:54

. , ,
.

(square)
.
_
// n //
i 1 n
j 1 n
square[i,j] 0
_
_
i1
j(n+1)/2
square[i,j]1
key 2 n*n
i>1
ki-1


kn
_
j>1
lj-1


ln
_
square[k,l]>0
ii+1

i=n+1 i1


ik
jl
_
square[i,j]key
_
// square //
_

4. 80
Q Q Q . ,
.

.
.

4.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 41

41

7/7/2013 5:19:54

1.
1 10 .
,
, .

. ;
2. CD
. CD
, ( ).
3. :
Expo
// x, n //
m n
pow 1
z x
m > 0
( m MOD 2 ) = 0
m m/2
z z * z
_
m m-1
pow pow*z
_
// pow //
Expo

MOD

(.. 14 MOD 3 = 2,
4 MOD 3 = 1), m/2

(.. 13/2 = 6,
25/3 = 8).

x=4, n=2

x=2, n=4

x=3, n=3

x=5, n=2


;
4.
.
. (
) ( )
.

42

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 42

7/7/2013 5:19:54

5. :
Q Q Q ( 1-100).
.


1000 .
6. Q Q Q (4) 10
. .

4.4.
1.

. , :
1. 
,
.
2.  ,
.
3.  .

2.

:
4.  _________________
.
5.  _________________
,
.
6.  _________________ ,
-.
7.  _________________
_________________.

4.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 43

43

7/7/2013 5:19:54

3.

:
8. , :
l

o .

9.  .
10.  .
4.

:
11. 
:

) ;

)  ;

) ;

) ; (.. )

)  ;
(.. )

12. :

) .

) .

) .

) .

) .

13. 
:

44

) .

) .

) 2.

) 
.

) -.

)  -,
.

) .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 44

7/7/2013 5:19:54

5.1.
,
. . .
,
. , .

5.2.
1
:
_
a 1
b 2
i 1 100
a i
b a * i

5 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 45

45

7/7/2013 5:19:54

_
a
b
_

.


a b
2

i
1
i
101
i
100
a
100
b (2100)
200
a,b
2

506


100 ,

.
.

2
:
__
// n //
i 1 n
j 1 n
A[i, j]
A[i, j]
_
_
__

46

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 46

7/7/2013 5:19:54

,
( ).
(
) n .

n * n * 2, .

.

3.

(bubblesort):
_
// //
i 1 n-1
j 1 n-1

A[j+1] < A[j]
A[j+1], A[j]

_
_
_
// //
_

:
1


, .
:

5 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 47

47

7/7/2013 5:19:54


i 1 (1 )
1

1 2

2 3

3 4

1 2

2 3

3 4

1 2

2 3

3 4

i 2 (2 )

i 3 (3 )

, 3 . ,
9 , 3
3 . n=4 . , (n-1)*(n-1)
n .



.
,
. 4 (
) .
:

48

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 48

7/7/2013 5:19:54

i 1 (1 )
4

i 2 (2 )

i 3 (3 )

3+2+1=6 4
( ). n
(n-1)+(n-2)+...+1 .

:
(n 1) + (n 2) +... + 1 + (n 1) (n 1) =

3 2 5
n
n+1
2
2

, n2, .

4. i- Fibonacci
.

/.

.

QQQ

i- Fibonacci. , .

5 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 49

49

7/7/2013 5:19:54

Fibonacci
// n //
n 1
Fib n

j 0
k 1
i 1 n
j j+k
k j-k
_
Fib j
_
// Fib //
Fibonacci

Fibonacci
// n //
n 1
Fib n

Fib 
Fibonacci(n-1) +
Fibonacci(n-2)
_
// Fib //
Fibonacci

, , ,
(n). .
, F5 Fibonacci (4) Fibonacci
(3). Fibonacci (4) Fibonacci (3).
Fibonacci (2) , Fibonacci (1)
Fibonacci (0) . O(Fn).
F5

F4

F3

F3

F5
F2

F1

F2

F1

F1

F2

F0

F1

F1

F0

F0
. 5.1. F5

50

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 50

7/7/2013 5:19:54

5.3. -

1.
. , :
1.

i 1 n -1 2
a 2*i
_

2.

i 1 n
j 1 n
a 2*i +j
_
_

3.

i 1 n 2
j 1 n
a 2*i +j
_
_

2.
SOS .
.
3. -
Fibonacci.
;
Fibonacci
i 1
j 0
k 0
l 1
n > 0
n MOD 2 = 1 m j*l
j i*l+j*k+m
i i*k+m
m (l) !
h 2*k*l+m
k (k)+m
n n DIV 2
_
Fib j
Fib
Fibonacci

5 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 51

51

7/7/2013 5:19:54

4.
.
1960 .

.

1. :
1.

i<100
a 2*i
_

2.

i 1 n -1
a 2*i
_

3.

i 1 n -1 3
a 2*i
_

2. :
_
x 10
c 20
i 100 10 _ -10
x i
y 2*x + i
_
x
y
_

.
3. Q Q Q ( ) 10 .

.

52

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 52

7/7/2013 5:19:54

4. :
_2
// //
i 1 n-1
j 1 n-1

A[j+1] < A[j]
A[j+1], A[j]

_
_
A[j]
_
// //
_2

.
2 2.
5.
(4);
;

5.4.
1.

. , :
1.  , .
2.  .
3. 
.

2.

:
4.  _____________ .
5.  (n2) _____________ .
6.  O(logn) _____________ .
7.  _____________ ,
.

5 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 53

53

7/7/2013 5:19:55

3.

:
8.  f(n),
O(g(n)) c n0,
n>=n0 : f(n) > c g(n)
9.  O(n2) .
10.  (n)
n .
11. 
.

4.

:
12.  :

) 

) 

) 

)  ..

) 

13. 
:

54

) 

) 

) 

) 

) 

) 

)  -

)  ,

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 54

7/7/2013 5:19:55

6.1.

.
.
.

.

6 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 55

55

7/7/2013 5:19:55

6.2. -
1. .

,
.

1
2
3

4




5
_
_

2. 1
, SOS .
,
.

:
1. .
, , , (
) .

1.
.
: , , , ,
, , , ..

.

56

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 56

7/7/2013 5:19:55

2. .
,
.

1
1
2

2

3

5
_
4
5

_
6

6.3.
1.

:
1.  _________________ .
2.  _________________
.
3.  ___________ _________________ .

2.

:
4.  Visual Basic .
5.  0 1.
6.  .
7. 4ns .

3.

:
8. :

6 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 57

57

7/7/2013 5:19:55

9. Pascal :

) 4

10. :

11. :

4.

) 
Pascal

) GOTO

:
12. :

) .

) .

)  : , .

) .

13. :

14. 
:

58

) LISP

) FORTRAN

) COBOL

) PROLOG

) JAVA

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 58

7/7/2013 5:19:55

7.1.
.
.
, ,
, , , .

.
Basic Pascal.

7.2.
1

. , , :

7 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 59

59

7/7/2013 5:19:55

1
Y (t ) = y 0 + v y 0t + gt 2
2
v0:
y0:
g:
:
vy0:  y, vy0 = v0 x(t) = x0+vx0t
x0:
v0: x, vx0 = v0
0,0, ,
, x = 2vx0vy0/g, .

Vy

0, 0

Vx

x
( ). 0,0
20 m/sec.
.


.
, ,
. 2 = 360 .

60

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 60

7/7/2013 5:19:55


_
!
!

G = 9.81

:V0,VX0,VY0,,

!
V0 < 20
!


!
VX0 < V0*()
VY0 < V0*HM()
< 2*VX0*VY0/G
!
,, :,
_

PASCAL
program ball;
const
g=9.81;
pi=3.14;
var
a:integer;
range,akt, v0,vx0,vy0:real;
begin
{ } vo:=20;
{ }
write( :);
readln(a);
{ }
akt:=a*pi/180;
vx0:=v0*cos(akt);
vy0:=v0*sin(akt);
range:=2*vx0*vy0/g;
writeln(,A:3, :,range:7:2);
end.

7 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 61

61

7/7/2013 5:19:55

BASIC

g = 9.81:pi=3.14
v0 = 20
INPUT =, a
a = a * pi / 180
vx0 = v0 * COS(a)
vy0 = v0 * SIN(a)
vel = 2 * vx0 * vy0 / g
PRINT =; vel
END

2
. , ,
.
:

a = i( p d )

(1+ i )m
(1+ i )m 1

a:
p:
d:
i:
m:
, ,

.
_
!

:, , ,

:_,,_, ,,
!:
!:
!:
!_: %
!:
!:
!_:
!:

:

:

62

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 62

7/7/2013 5:19:56


:
_
:

< (_/12)/100
< -
< (1+)^/((1+)^-1)
< **
_ < *+
< _/*100
:,
:, _,
, ,%
_

7.3. -
,
, , .
.
l . ,

.
l
.
l ,
.
l .
l
.
l .
. .

.
l . .

7 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 63

63

7/7/2013 5:19:56

7.4. -
1. :

1. :
T = 2

m
D

2. :
1
E = mv 2
2
3.  :
F = F12 + F22 + 2F1F2
4. :
+ 2 4
2
2. ; .
1. .
2. .
3. .
4. .
5. .
6. ( ;)
3. .

:

= ( )( )( )
+ +
.
2

. .
, =

64

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 64

7/7/2013 5:19:57

:
1. 2,
. .
2. (x1,y1) (x2,y2)
:
d = ( x1 x 2 )2 + ( y1 y 2 )2
.
3. , . , .

1. Celsius Fahrenheit
:
9
F = C + 32
5
Celsius
Fahrenheit.
2. :
T = 2

L
g

L g .
.
.
3. . ,
(
) =55004, .
0,02m. ()
. ,
33% 80% ,
.
( 0.01m)
10%, 33% 50%.

7 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 65

65

7/7/2013 5:19:57

7.5.
1.

. , :
1. )

2.

2. ) ,

) < * 100

) < + * 0.18

:
3. 
________________ .
4. ________________ .

3.

:
5.  .
6. =.
7.  , .
8. .

4.

:
9.  :
100
)
< 100 )
< 100

100 , 100
)
,

)  < 100
,

10.  < 5*(-3)+^3-2+


, =5 = 1:

) 35

) 134

) 22

) 148

11. :

66

< 100
< (2+_()*3/10)^2-(+50)/5

) 22

) -5

) 10

) 25

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 66

7/7/2013 5:19:57

12. 
.
:


5.

A) +1 <
B) < +1

) < +1

) = +1

:
13. :

14. :

) 1

) --$

) 1

7 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 67

67

7/7/2013 5:19:57

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 68

7/7/2013 5:19:57

8.1.
.
:
.
, _ _
.
.
, ,
, .
, ,
Basic
Pascal.

8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 69

69

7/7/2013 5:19:57

8.2.
1
,
, , .
(O2), (CO), (SO2),
(O3) .

.
O3 O2 .

2 (g/m3)
3 (g/m3)

400
250


!
!
500
700
300
500

2 3
.

:O2, O3


O2

O3
O2>700 O3 > 500

_ O2 > 500 O3 > 300

_ O2 > 400 O3 > 250



_
_

70

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 70

7/7/2013 5:19:57


.

-_,

.

.

.

PASCAL
program rypoi;
var
no2,o3:real;
begin
write ( TOY :); readln (no2);
write ( TOY :); readln (o3);
if (no2 > 700) or (o3 > 500) then
write ( )
else if (no2 > 500) or (o3 > 300) then
write ( )
else if (no2 > 400) or (o3 > 250) then
write ( )
else
write ( )
endif
end.

BASIC
rypoi
INPUT N2=, N2
INPUT 03=, 03
IF N2 > 700 OR 03 > 500 THEN
PRINT
ELSEIF 2 > 500 OR 03 > 300 THEN
PRINT 2
ELSEIF 2 > 400 OR 03 > 250 THEN
PRINT
ELSE
PRINT
END IF
END

8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 71

71

7/7/2013 5:19:57

2
. .
/

0-15
16-60
61-81
82-105
>105

0,34
0,52
1,51
2,11
2,64

( 1,47), 40% , 1% 18% .


,
, ( )
.

0 .
_

=0.18
1=0,34
2=0,52
3=1,51
4=2,11
5=2,64
=1,47

:

:, , , , _, ,
& _
: ,

(0 )

<> 0

,



<= 15

72

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 72

7/7/2013 5:19:58

<- *1
<= 60
<- 15*1+(-15)*2
<= 81
<- 15*1+45*2+(-60)*3
<= 105
<- 15*1+45*2+21*3+(-81)*4
_
<- 15*1+45*2+21*3+24*4+(-105)*5
_
<- *0.4
<- *0.01
<- + + +
_ <- *
_ <- + _
, , , _
:,
:, + , :, _
(0 )

_
_

3
1
20 80 10 .
10 /sec 40 /sec
10 /sec.
( )
.


_2

G = 9.81

:V0,VX0,VY0,,

20 80 _ 10
:,
VO 10 40 _ 10
VX0 <- V0*()
VY0 <- V0*HM()
<- 2*VX0*VY0/G

8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 73

73

7/7/2013 5:19:58

:,V0,:,
_
_
_

PASCAL
program ball_2;
const
g=9.81;
pi=3.14;
var
v01,a:integer;
range,akt,v,v0,vx0,vy0:real;
begin
for a:=2 to 8 do

begin
{ }
akt:=a*10*pi/180;
writeln ( :,a*10:5);
for v01:=1 to 4 do
begin

v0:=v01*10;
vx0:=v0*cos(akt);
vy0:=v0*sin(akt);
range:=2*vx0*vy0/g;
writeln(ME :,v0:5,:,range:7:2);
end;
end;
end.

Pascal For, 1 -1,


.
10 80 10 , a 2 8,
10 : akt:=a*10*pi/180.
01 1 4 10 , 0:=01*10.

BASIC
2
g=9.81
FOR a = 20 TO 80 STEP 10
akt = a * ATN(1) * 4 / 180
PRINT ;akt
FOR v0 = 10 TO 40 STEP 10
vx0 = v0 * COS(akt)
vy0 = v0 * SIN(akt)

74

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 74

7/7/2013 5:19:58

vel = 2 * vx0 * vy0 / g

PRINT = ; vel

PRINT ME ;v0

NEXT v0

NEXT a

ATN . (1)=/4,
(/4)=1.

END

8.3. -
, ,
,
.

.
.
l

,
. ,
, ,
.
, , -_ .
_
,
( ).
,
, , _ .
.
,
.
, ,
. , ,
.

8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 75

75

7/7/2013 5:19:58

8.4. -

1. 10, 5
3, .
A) ( > )
B) > < <=
) > ( < <=
) = (-) < 0
) ( > < ) ( <> < )
2. :
)  () (),
, 2 , , , 2 , .
)  () 1 ()
15, ().
)  () ,
....
)  ()=0,
...,
(^2+5*)/(_()*()).
3. 1
.
4. :
<- 0

0 100 _ 5

<- ^3

<- +

;
;

_.
;

76

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 76

7/7/2013 5:19:58

5. . ;
, .
)

<>0
<- 0
>

<-
_
<

<-
_
<- +
_

)
_
<- 0
>

<-
_
<

<-
_
<- +

_ <>0

)
1 100
<- 0

>

<-
_
<

<-
_
<- +
_

. .

8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 77

77

7/7/2013 5:19:58

:
1.

:
17,5 20

15,5 17,4

13,5 15,4

9,5 13,4

0 9,4

...
... ... _

2. 2 .
. .
3. , ,
.

.
1.
2.
3.
4.
5.
:__
4. 1, ,
6 5
.




. : www.minenv.gr

78

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 78

7/7/2013 5:19:58

5.
Q Q . R
C :

R = R1 + R2 + R3 + ...
c=

1
1
1
+ + + ...
c1 c2 c3


c = c1 + c2 + c3 + ...
R=

1
1
1
+ + + ...
R1 R2 R3

1. ,
.

. 1999

1.055.000
0
0
1.055.000
0
1.582.500
5
79.125
2.637.500
79.125
1.582.500
15
237.375
4.220.000
316.500
3.165.000
30
949.500
7.385.000
1.266.000
8.440.000
40
3.376.000
15.825.000
4.642.000

45
:
(), , .
:
,
. 0.
2.
x2 + x + = 0. , .

8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 79

79

7/7/2013 5:19:58

3. ,
. , .
4. y(x) = x2 - 3x + 2
x 1 3 0.1.
5.
Q Q Q :
x = x

x3 x5 x7
+ + ...
3! 5! 7!

x = 1

x2 x4 x6
+ + ...
2! 4! 6!

x
.
;
: x .
6. Q Q .

8.5.
1.

. ,
.
1.
)
) >0
) _
)
) <-_()
2.
) _ (= =)
)
) _
) :

2.

:
3.  .
4.  .

80

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 80

7/7/2013 5:19:58

5.  _.
6. 
.
7.  5 6, >5 <3
>5 .
3.

:
8. 
100 .
)

< 0
1 100

< +
_
< 0
1 100 _ 2

< +
_
1 100 _ 2

< 0

< +
_
1 100 _ 2

<
_

9.  :
< 0
10 20 _ 10

A < +^2
_

) 0

) 100

) 500

) 400

10.  :
_

< 0

1 5
< -1

_
_ =0

) 10

) 0

) 5

8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 81

81

7/7/2013 5:19:58

11.  :
< 1
1 10 _ 2

< *
_

:
)

< 1
< 1
<= 10
< +2
< *
_

< 1
< 1
<=10
< *
< +2
_

< 1
< 1
_
< *
< +2
_ I<10

< 1
< 1
_
< *
< +2
_ I=10

12.  :
1 2 _ 3

_

) 2

) 0

) 1

13.  :
< 10

<
< 0

< -
_
< 0

82

)  .

)  .

)  0.

)  10.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 82

7/7/2013 5:19:58

9.1.

.

.

, . ,
.
, .
3 4,
.
, ,
Basic
Pascal.

9.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 83

83

7/7/2013 5:19:58

9.2.
1
50
.
.
_

:,, [50],
:
:[50]

_
.. ( 50)

_ <=50
<- 0
1

[]

[]
<- +E[]
_
MO <- /

1
[]> MO
[]
_
_
_

.
,

.

, ,
.

84

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 84

7/7/2013 5:19:58

PASCAL
program air_co;
var
n,i,sum:integer;
ave:real;
tickets:array[1..50] of integer;
company:array[1..50] of string;
begin
repeat
write( :);readln(n);
until (n<=50);
sum:=0;
for i:=1 to n do
begin
write( :); readln(company[i]);
write( :);readln(tickets[i]);
sum:=sum+tickets[i];
end;
ave:=sum/n;
for i:=1 to n do
begin
if tickets[i] > ave then
writeln (company[i]);
end;
end.

Basic

DIM company$(50), (50)
DO
INPUT :, n
LOOP UNTIL n <= 50
sum = 0
FOR i = 1 TO n
PRINT ; i; :";
INPUT , company$(i)
PRINT =;
INPUT , E(i)
sum = sum + (i)
NEXT i
MO = sum / n
PRINT
PRINT ===========================
FOR i = 1 n
IF E(i) > MO THEN PRINT company$(i)
NEXT i
END

9.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 85

85

7/7/2013 5:19:58

2

( decibel -dB). :

GX
LX
Gti
SX

40
88
75
80
68

(km/h)
60
80
100
90
93
105
78
81
89
85
90
96
78
85
102

120
112
95
101
105


,
.

:[4,5],I,J,[5],, _
:[4]
:,_
!
1 5
..
[]
_
1 4
..
[]
..
J 1 5
[I,J]
_
_
!
_ <- 0
1 4
<- 0
J 1 5
<- +[I,J]
_
_ <- _+
<- /5
[I], :,

86

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 86

7/7/2013 5:19:58

_
J 1 5
<- 0
1 4
<- +[I,J]
_
<- /4
[J] :,
_
_ <- _/20
:, _
_

3
, . .
100 .
.
.
,
, , ,
+ .
i, j k
, . :

. .
.

:[100], [100], [200], I, J, , , ,


!
!

!
(<100)

1
[I]
_

9.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 87

87

7/7/2013 5:19:59

(<100)

1
[I]
_
!
! I
! J
!
I <- 1
J <- 1
<- 1
I <= J <=
!
[] < B[J]
[] <- [I]
<- +1
I <- +1

[] <- B[J]
<- +1
J <- J +1
_
_
!
I >
+
[] <- B[J]
J <- J +1
_

+
[] <- [I]
I <- +1
_
!
1 +
[]
_
_

88

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 88

7/7/2013 5:19:59

PASCAL
program merge;
var
i,j,k,l,n,m: integer;
a,b: array[1..100] of integer;
c: array[1..200] of integer;
{ C }
begin
write ( (n) ); readln(n);
for i:=1 to n do
readln(a[i]);
write ( (m) ); readln (m);
for i:=1 to m do
readln (b[i]);
i:=1; j:=1; k:=1;
while (i<=n) and (j<=m) do
if (a[i]<b[j]) then
begin
c[k]:=a[i];k:=k+1;i:=i+1;
end
else
begin
c[k]:=b[j]; k:=k+1; j:=j+1;
end;
if i>n then
for l:=k to n+m do
begin
c[l]:=b[j]; j:=j+1;
end
else
for l:=k to n+m do
begin
c[l]:=a[i]; i:=i+1;
end;
for l:=1 to n+m
write (c[l]);
end.

Basic
Merging
DIM a(100), b(100), c(200)
READ n
FOR i = 1 TO n: READ a(i): NEXT i
DATA 5
DATA 2,7,12,18,26

9.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 89

89

7/7/2013 5:19:59

READ m
FOR i = 1 TO m: READ b(i):
DATA 5
DATA 1,6,10,15,25
i = 1: j = 1: k = 1
WHILE i <= n AND j <= m
IF a(i) < b(j) THEN
c(k) = a(i): k = k +
ELSE
c(k) = b(j): j = j +
END IF
WEND
IF i > n THEN
FOR r = k TO n + m
c(r) = b(j): j = j +
NEXT r
ELSE
FOR r = k TO n + m
c(r) = a(i): i = i +
NEXT r
END IF
FOR i = 1 TO m + n
PRINT c(i)
NEXT
END

NEXT i

1: i = i + 1
1: k = k + 1

9.3. -

.
.
l

.
, .
.
:

.
 .

.

 .
.

 ,
.


.

90

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 90

7/7/2013 5:19:59

9.4. -

1. ,
.
) 5 .
) .
) .
)  10 , 500
, 250, 125 ...
2. ,
. .
3. .
1

4. 5x6.

:
1.
(9
),
( ).
2. 2 ( )
.
.
3. 4 ( ) .
4. 2, .

9.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 91

91

7/7/2013 5:19:59

1. 1 ( ),
,
.
2. .
: a b c , :
:

c ij = aij + bij

/:

c ij = aik bkj

k =1

3. x.
4. d
Q Q b, 2 b 16 d b.
5. .
. 3.
6. 1(,) 1(,) Q Q Q EuroBasket. 1 (
() ()), 1 .

.
.



( !).

,
(
).

92

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 92

7/7/2013 5:19:59

9.5.
1.

:
1. ________ .
2. _________ .
3.  _________
<- 0
1

<- +[,]
_

2.

:
4. .
5.  .
6.  100
.
7. .

3.

:
8. 
2x2:
)

1 2
[,]
_

1 2
[]
_

1 2
J 1 2
[I,J]
_
_

1 2
J 1 2

_
_

9. 8x10:
1 8

<- 0

J 1 10
<- +[,J]

_

<- /10


_

9.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 93

93

7/7/2013 5:19:59

) .

) .

) .

) .

10. :
1 10

[] <- 10+I
_
<- 0
O 1 10 _ 2

<- +[]
_


4.

) 75

) 155

) 50

) 125

:
11. :

12. :

94

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 94

7/7/2013 5:19:59

10

10.1.

. ,
.
,
,
.
.
,

.
,
.
Basic Pascal.

1 0 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 95

95

7/7/2013 5:19:59

10.2.
1

. , ,
9.
:
__: . , .
: .
_: .

: , , 
[100], ,
, _2,
: ,_,

!
( 100)

1

[]
_
__(, , , _)
(, )
<- _(,)
!
, ,
:,
: , _
:,
_
__(, , , )
!
!

:[100],, , , _2
:,

96

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 96

7/7/2013 5:19:59

<- 0
_2 <- 0
1
<- + []
_2 <- _2+ []^2
_
<- /
<- _(_2 / ^2)
_ __
(, )
!

:I,1,,, [100],

1 <-
_
<- 0
1 1-1
[] > [+1]
<- []
[] <- [+1]
[+1] <-
<-
_
_
1 <-
_ =0
_
_(,):
:[100],

MOD 2 =0
_ <- ([/2]+[/2+1])/2

_ <- [(+1)/2]
_
_ _

Pascal
program Statistiki;
type list=array[1..100] of integer;
var
avg, st_dev:real;
i,median,n:integer;

1 0 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 97

97

7/7/2013 5:19:59

a:list;
{----------------------}
procedure sort(var a:list;n:integer);
{ }
var
i,n1,t,temp:integer;
begin
n1:=n;
repeat
t:=0;
for i:=1 to n1-1 do
if a[i]>a[i+1] then
begin
temp:=a[i];
a[i]:=a[i+1];
a[i+1]:=temp;
t:=i;
end;
n1:=t;
until t=0;
end;
{--------------------- -}
procedure ave_stdev(a:list;n:integer;var average,stddv:real);
{ }
var
i:integer;
sum, sum_2:real;
begin
sum:=0; sum_2:=0;
for i:=l to n do
begin
sum:=sum+a[i]; sum_2:=sum_2+sqr(a[i]);
end;
average:=sum/n;
stddv:=sqrt (sum_2/n - sqr(average)) ;
end;
{--------------------- -}
function med(a:list; n:integer):real;
{ }
begin
if n mod 2=0 then
med:=(a[n div 2]+a[(n div 2)+1])/2
else
med:=a[(n+1) div 2];
end;
begin { }
write( (<100):);
readln (n);

98

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 98

7/7/2013 5:20:00

for i:=1 to n do
begin
write ( TON , i:3,o :);readln (a[i]);
end;
ave_stdev (a,n,avg,st_dev);
qsort(a,1,n);
median:= med(a,n);
writeln ( :, avg, :,st_dev);
writeln( :,median);
end.

Basic
DECLARE FUNCTION Median! (x!(), n!)
DECLARE SUB Sort (k!(), n!)
DECLARE SUB MeanAndStdDev (z!(), m!, s!)

DIM x(100)
DATA 7
DATA 1,5,7,12,9,13,6
READ n
FOR i = 1 TO n: READ x(i): NEXT i

CLS
CALL MeanAndStdDev(x(), mx, sx)
CALL Sort(x(), n)
med = Median(x(), n)

CLS
PRINT *** ***
PRINT ------------------
PRINT mx=; mx, sx=; sx
PRINT median=; med
END
SUB MeanAndStdDev (z(), m, s)

s1 = 0: s2 = 0
n = UBOUND(z)
FOR i = 1 TO n
s1 = s1 + z(i)
s2 = s2 + z(i) * z(i)
NEXT i
m = s1 / n
s = SQR(s2 / n - m * m)
END SUB
FUNCTION Median (x(), n)
IF n MOD 2 = 0 THEN
Median = (x(n / 2) + x (n/2 + 1 ) /2

1 0 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 99

99

7/7/2013 5:20:00

ELSE
Median = x((n + 1) / 2)
END IF
END FUNCTION
SUB Sort (x(), n) STATIC
k = n
DO
t = 0
FOR i = 1 TO k - 1
IF x(i) > x(i + 1) THEN
SWAP x(i), x(i + 1)
t = i
END IF
NEXT i
k = t
LOOP UNTIL t = 0
END SUB

2
QQQ

,
, .

,
.
, , :

l
l

100

, .
.
.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 100

7/7/2013 5:20:00


.
. ,
,
( , ).
, -,
.

:
l

, 1 3.
= 1.
, :
1 2.
2 3.
2 3.

-1 , :
l

-1 1 2, 3
.
, ,
1 3.
-1 2 3, 1
.

:
__

1=
2=
3=



(, 1, 2, 3)
_

1 0 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 101

101

7/7/2013 5:20:00

(,, ,)

:
: , ,

=1
, , ,

(-1, , ,)
, , ,
(-1, , , )
_

Pascal
program anoi;
const
st1=A;
st2=B;
st3=;
var
n:integer;
procedure move(n:integer;sta,stb,stc:char);
begin
if n=1 then
begin
writeln( ,sta, ,stc)
end
else
begin
move(n-1,sta,stc,stb);
writeln ( , sta, ,stc);
move (n-1,stb,sta,stc)
end;
end;
begin
write ( :); readln(n);
move (n,st1,st2,st3);
end.

Basic
DECLARE SUB Move (n!, a$, b$, c$)
Anoi
INPUT N=, n
CALL Move(n, A, B, C)
END

102

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 102

7/7/2013 5:20:00

SUB Move (n, a$, b$, c$)


IF n = 1 THEN
PRINT Move ; a$; to ; c$
ELSE
CALL Move(n - 1, a$, c$, b$)
PRINT Move ; a$; to ; c$
CALL Move(n - 1, b$, a$, c$)
END IF
END SUB

4 :















.
.
, 15 4 . 5
31.
2-1 . 10
1023 20 .
64 1,845 x 1019,
20 . ; (
), !!!

((2)).
5
,
.

1 0 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 103

103

7/7/2013 5:20:00

10.3. -


. .
l

,

. .
.

.

.
.

.
.

, :
l

N . , , .. .
.

.

10.4. -

1. ,
:
) .
) .
) .
) .
) .
) , , .
) .

104

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 104

7/7/2013 5:20:00

2. :
) .
) .
) 
.
) .
3. , , 4!,
,
.

:
1. , () ()
.
: x, y : xy = (x,y)(x,y)
2. 1.
3. .
+i +i :
(+i)+(+i) = (+)+(+)i
(+i)(+i) = ()+()i
(+i)(+i) = ()+(+)i

+



+ i
= 2 2 + 2 2 i
+ i + +

.

0.
4. 1 .
.

1 0 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 105

105

7/7/2013 5:20:00

1. , ,
. .
2. 6 9,
EuroBasket, .
3. 1, ,
Q Q .
4. 5 8 .
5. . Q Q Q ,
, .
/ + / = /

: ,
.
, , .

( ) . 1.

6. ex 2x 1 = 0.
Q Q [1,2] ,
4.3 .

106

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 106

7/7/2013 5:20:00

10.5.
1.

:
1. 
_________________ .
2.  _____________ _____________.
3.  _________________
.

2.

:
4.  .
5.  .
6. 
.
7. .

3.

:
8. :

9. :

<- 5
<- 10
<- 0
1(, )
,,

1(,)

<- -
_ 1

) 5,10,0

) 5,10,-5

) -5,10,0

) -5,10,-5

10. :

<- 5
<- 10
1(, )
,

1(,)
1 0 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 107

107

7/7/2013 5:20:00

,
<- -
_ 1



4.

) 5,10
5,10

) 10,5
5,5

) 5,10
-5,10

) 10,5
5,10

:
11. :

12. :

108

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 108

7/7/2013 5:20:00

11

11.1.
,
.
.
, .

, . , .
, ,
Visual Basic for Windows, ,
Basic
. ,
Delphi. Delphi , Visual Basic.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 109

109

7/7/2013 5:20:00

11.2.
1

.
. .

Visual Basic

. :
l

(form)
,
(command buttons)
,

(labels) ,

(line) .

, Visual Basic
Form1. ,
. (toolbox) Visual Basic.
:

110

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 110

7/7/2013 5:20:00

1
2
3

Name

FrmMain

Caption

Name

CmdStep1

Caption

Name

CmdStep2

Caption

Name

CmdStep3

Caption

Name

CmdEnd

Caption

()

Style

1-Graphical

Picture

\vb\graphics\icons\traffic\Trffc14.ico

Name

LblTitle

Visible

True

Caption

ForeColor

&H000000C0&

Name

LblStep1

Visible

False

Caption

ForeColor

&H8000000D& (Highlight)

Name

LblStep2

Visible

False

Caption

ForeColor

&H8000000D& (Highlight)

Name

LblStep3

Visible

False

Caption

ForeColor

&H8000000D& (Highlight)

Name

Lntitle

ForeColor

&H000000C0&

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 111

111

7/7/2013 5:20:00

.
Visual Basic Delphi,
, :
. =
, , Text1,
:
Text1 .Text=
:
.
List1 Clear:
List1.Clear

(arguments) . :
.

Image1, Move :
Image1.Move 100, 200
Image1 (100, 200).
Visual Basic
:
Private Sub CmdStep1_Click()

Visible

Visible True
False.
LblStep1.Visible = True
LblStep2.Visible = False
LblStep3.Visible = False
End Sub
Private Sub CmdStep2_Click()

LblStep1.Visible = False
LblStep2.Visible = True
LblStep3.Visible = False
End Sub

112

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 112

7/7/2013 5:20:01

Private Sub CmdStep3_Click()



LblStep1.Visible = False
LblStep2.Visible = False
LblStep3.Visible = True
End Sub
Private Sub CmdEnd_Click()

End
End Sub

Delphi
program Prj1;
uses
Forms,
Unit1 in Unit1.pas {LblStep1};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TLblStep1, LblStep1);
Application.Run;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls
, Forms,
Dialogs,
StdCtrls, Buttons;
type
TLblStep1 = class(TForm)
Title1: TLabel;
CmdStep1: TButton;
CmdStep2: TButton;
CmdStep3: TButton;
LblStep1: TLabel;
LblStep2: TLabel;
LblStep3: TLabel;
CmdEnd: TBitBtn;
procedure CmdStep1Click(Sender: TObject);
procedure CmdStep2Click(Sender: TObject);
procedure CmdStep3Click(Sender: TObject);
procedure CmdEndClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 113

113

7/7/2013 5:20:01

LblStep1: TLblStep1;
implementation
{$R *.DFM}
procedure TLblStep1.CmdStep1Click(Sender: TObject);
begin
LblStep1.Visible := True;
LblStep2.Visible := False;
LblStep3.Visible := False;
end;
procedure TLblStep1.CmdStep2Click(Sender: TObject);
begin
LblStep1.Visible := False;
LblStep2.Visible := True;
LblStep3.Visible := False;
end;
procedure TLblStep1.CmdStep3Click(Sender: TObject);
begin
LblStep1.Visible := False;
LblStep2.Visible := False;
LblStep3.Visible := True;
end;
procedure TLblStep1.CmdEndClick(Sender: TObject);
begin
close;
end;
end.

2
(password). , , *.
, .

Visual Basic
:
l

(text box) ,

(label), ,

114

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 114

7/7/2013 5:20:01

1
2

Name
Caption
Name
Caption
Name
Passwordchar
Text

Frmpwd

Lblpwd
:
Txtpwd
*
()

Name

CmdOK

Caption
Name
Caption

OK
CmdEnd

( 11.1).

. 11.1.
. Date.
Visual Basic.
MsgBox, :
Msgox([, ] [, ] [, , ])
MsgBox, , . , Visual
Basic ,
.

. ,
-

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 115

115

7/7/2013 5:20:01

.
.
:

vbOKOnly

OK .

vbOKCancel

OK Cancel .

vbAbortRetrygnore

Abort, Retry Ignore .

vbYesNoCancel

Yes, No Cancel .

vbYesNo

Yes No .

vbRetryCancel

Retry Cancel .

vbCritical

16

vbQuestion

32

vbExclamation

48

vbnformation

64

. , vbOKCancel + vbExclamation
Cancel .

MsgBox, :

vbOK

OK

vbCancel

Cancel

vbAbort

Abort

vbRetry

Retry

vbgnore

Ignore

vbYes

Yes

vbNo

No


.
MsgBox.
, :
If Response = vbOK Then

End IF
If Response = 1 Then

End IF

116

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 116

7/7/2013 5:20:01

:
Private Sub CmdOK_Click()
If Txtpwd.Text = Date Then
MsgBox ( !!!)
Else
Dim Response As String

Response = MsgB
ox( . ;, vbYesNo +
vbCritical, )
If Response = vbYes Then

Txtpwd.Text =
Txtpwd.SetFocus
Else

CmdEnd_Click
End If
End If
End Sub
Private Sub CmdEnd_Click()
End
End Sub

Setfocus

.

. 11.2.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 117

117

7/7/2013 5:20:01

,
.
, .
,
No
MsgBox,
End, CmdEnd_Click
.
.

Delphi
program Prj2;
uses
Forms,
Unit2 in Unit2.pas {Frmpwd};
{$R *.RES)
begin
Application.Initialize;
Application.CreateForm(TFrmpwd, Frmpwd);
Application.Run;
end.
unit Unit2;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls,
StdCtrls,
Buttons,Dialogs;
type
TFrmpwd = class(TForm)
Label1: TLabel;
Txtpwd: TEdit;
CmdOK: TButton;
CmdEnd: TButton;
procedure CmdEndClick(Sender: TObject);
procedure CmdOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

118

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 118

7/7/2013 5:20:01

var
Frmpwd: TFrmpwd;
implementation
{$R *.DFM}
procedure TFrmpwd.CmdEndClick(Sender: TObject);
begin
close;
end;
procedure TFrmpwd.CmdOKClick(Sender: TObject);
begin
if Txtpwd.Text = DateToStr(Date) then
ShowMessage( !!!)
else
begin
if 
MessageDlg( . ?,
mtConfirmation , [mbYes, mbNo], 0 ) = mrYES then
begin

Txtpwd.Text := ;
Txtpwd.SetFocus;
end
else
close;
end;
end;
end.

3

.

.

Visual Basic
:
l

(image) ,

,
(timer). .

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 119

119

7/7/2013 5:20:02

1
2
1
2

Name

FrmPlane

Caption

To

Name

imgplane

Height

480

Picture

\vb\graphics\icons\industry\plane.ico

Stretch

True

Width

480

Name

Line1

BorderWidth

Name

Line2

BorderWidth

Name

CmdStart

Caption

Name

CmdEnd

Caption

Name

Tmrmove

Interval

(. 11.3).

. 11.3.

120

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 120

7/7/2013 5:20:02

Timer,
. Interval
Timer.
0 .

,
.


,
.

, Timer
Move, , Left Top Width Height
. :
Left:

Top:
Width:
Height:
.
.
:
1 : x
2 : x
1 : y
2 : y
,
:
Private Sub CmdStart_Click()

5 Interval

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 121

121

7/7/2013 5:20:02

Timer1.Interval = 5
End Sub
Private Sub Timer1_Timer()


.
1 
y
.
If Imgplane.Top < Line1.Y1 Then
Imgplane.Move Imgplane.Left + 25, Imgplane.Top + 20,
Imgplane.Width + 5, Imgplane.Height + 5
Else
Timer1.Interval = 0

End If
End Sub
Private Sub CmdEnd_Click(Index As Integer)

End
End Sub

. 11.4.

Delphi
program Prj3;
uses
Forms,
Unit3 in Unit3.pas {FrmPlane};
{$R *.RES)
begin

122

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 122

7/7/2013 5:20:02

Application.Initialize;
Application.CreateForm(TFrmPlane, FrmPlane);
Application.Run;
end.
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
StdCtrls, Buttons, ExtCtrls;
type
TFrmPlane = class(TForm)
Imgplane: Image;
Panel1: TPanel;
Panel2: TPanel;
CmdStart: TBitBtn;
CmdEnd: TBitBtn;
Timer1: TTimer;
procedure CmdStartClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure CmdEndClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmPlane: TFrmPlane;
implementation
{$R *.DFM)
procedure TFrmPlane.CmdStartClick(Sender: TObject);
begin
Timer1.Interval := 1000;
end;
procedure TFrmPlane.Timer1Timer(Sender: TObject);
begin
if ImgPlane.Top < Panel1.Top then
begin
ImgPlane.Top := ImgPlane.Top + 20;
ImgPlane.Left := ImgPlane.Left + 25;
ImgPlane.Height := ImgPlane.Height + 5;
ImgPlane.Width := ImgPlane.Width + 5;
end;
end;
procedure TFrmPlane.CmdEndClick(Sender: TObject);
begin
close;
end;
end.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 123

123

7/7/2013 5:20:02

4

.

Visual Basic
:
l ,
l .
:

Name
Caption
Name
Multiline
Text

FrmMain

TxtEdit
True
()

To . Visual Basic (menu


editor) ( 11.5).
.
,
.
, :

. 11.5. Visual Basic

124

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 124

7/7/2013 5:20:02

&

&

&

( Caption)
&
&
&
&
&
&
&

( Name)
mnunew
separator1
mnuprint
separator2
mnuexit
mnucut
mnucopy
mnupaste
separator3
mnuSelall
mnuAbout


( Shortcut)
Ctrl+
Ctrl+

Ctrl+X
Ctrl+C
Ctrl+V
Ctrl+A

Caption ,
Name
Shortcut
.

( 11.6).

. 11.6.


.
(project) , :
l

(shape) ,

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 125

125

7/7/2013 5:20:03

Caption

Name

FrmAbout

Alignment

2-Center

Caption

ForeColor

&H8000000D& (Highlight)

Name

Lblinfo1

Alignment

2-Center

Caption

ForeColor

&H8000000D& (Highlight)

Name

Lblinfo2

ForeColor

&H8000000D& (Highlight)

Name

Shape1

Shape

O-Rectangle

Name

Image1

Picture

\vb\graphics\icons\writing\note16.ico

Stretch

True

Caption

OK

Name

CmdBack

( 11.7)
.

. 11.7.

126

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 126

7/7/2013 5:20:03


Visual Basic, Printer
Clipboard () ,
.
Printer Print. Printer,
EndDoc.
Clipboard .
Clipboard, SetText GetText, ,
, SetData GetData.
Len,
:
l
l

SelLength: .
SelStart: .
SelText: ()
.


.
Private Sub mnunew_Click()


Text.
Text1.Text =
End Sub
Private Sub mnuprint_Click()
TxtEdit
Printer
Printer.Print TxtEdit.Text
Printer.EndDoc
End Sub
Private Sub mnuexit_Click()
End
End Sub
Private Sub mnucut_Click()

TxtEdit
Clipboard.
Clipboard.SetText TxtEdit.SelText
TxtEdit
TxtEdit.SelText =
End Sub
Private Sub mnucopy_Click()
 TxtEdit
Clipboard.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 127

127

7/7/2013 5:20:03

Clipboard.SetText TxtEdit.SelText
End Sub
Private Sub mnupaste_Click()
Clipboard 

TxtEdit
TxtEdit.SelText = Clipboard.GetText
End Sub
Private Sub mnuSelall_Click()


TxtEdit.
TxtEdit.SelStart = 0
TxtEdit.
TxtEdit.SelLength = Len(TxtEdit.Text)
End Sub
Private Sub mnuAbout_Click()
Show .
FrmAbout.Show
End Sub


OK o .
Private Sub CmndBack_Click()
Hide .
FrmAbout.Hide
End Sub

True Multiline.
,
.
, Print Printer .
Enter.

Delphi
program Prj4;
uses
Forms,
Unit4 in Unit4.pas {Form1},
Unit41 in Unit41.pas {FrmAbout};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);

128

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 128

7/7/2013 5:20:03

Application.CreateForm(TFrmAbout, FrmAbout);
Application.Run;
end.
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
Menus, StdCtrls, Printers;
type
TForm1 = class(TForm)
Memo1: TMemo;
MainMenu1: TMainMenu;
mnuEdit: TMenuItem;
mnuFile: TMenuItem;
mnuAbout: TMenuItem;
mnuNew: TMenuItem;
mnuPrint: TMenuItem;
mnuExit: TMenuItem;
mnuCut: TMenuItem;
mnuPaste: TMenuItem;
mnuCopy: TMenuItem;
mnuSelAll: TMenuItem;
procedure mnuExitClick(Sender: TObject);
procedure mnuCutClick(Sender: TObject);
procedure mnuCopyClick(Sender: TObject);
procedure mnuPasteClick(Sender: TObject);
procedure mnuNewClick(Sender: TObject);
procedure mnuSelAllClick(Sender: TObject);
procedure mnuAboutClick(Sender: TObject);
procedure mnuPrintClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit41;
{$R *.DFM}
procedure TForm1.mnuExitClick(Sender: TObject);
begin
close;
end;
procedure TForm1.mnuCutClick(Sender: TObject);
begin
Memo1.CutToClipboard;
end;

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 129

129

7/7/2013 5:20:03

procedure TForm1.mnuCopyClick(Sender: TObject);


begin
Memo1.CopyToClipboard;
end;
procedure TForm1.mnuPasteClick(Sender: TObject);
begin
Memo1.PasteFromClipboard;
end;
procedure TForm1.mnuNewClick(Sender: TObject);
begin
Memo1.Clear;
end;
procedure TForm1.mnuSelAllClick(Sender: TObject);
begin
Memo1.SelStart := 0;
Memo1.Sellength := 32767;
end;
procedure TForm1.mnuAboutClick(Sender: TObject);
begin
FrmAbout.Show;
end;
procedure TForm1.mnuPrintClick(Sender: TObject);
var
index: Integer;
begin
Printer.BeginDoc;
for index := 0 to Memo1.Lines.Count-1 do
Printer.Canvas.TextOut(100,10+index*50,Memo1.Lines[index]);
Printer.EndDoc;
end;
end
unit Unit41;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
StdCtrls, ExtCtrls;
type
TFrmAbout = class(TForm)
CmndBack: TButton;
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Image1: TImage;
procedure CmndBackClick(Sender: TObject);
private
{ Private declarations }

130

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 130

7/7/2013 5:20:03

public
{ Public declarations }
end;
var
FrmAbout: TFrmAbout;
implementation
{$R *.DFM)
procedure TFrmAbout.CmndBackClick(Sender: TObject);
begin
FrmAbout.Hide;
end;
end.

5
.
.

Visual Basic
:
l

(option buttons) ,

(frame) ,

1
2
3
4

Name

FrmMain

Caption

video

Name

Option1

Caption

Name

Option2

Caption

Name

Option3

Caption

Name

Option4

Caption

Name

FrOptions

Caption

Name

LblTitle0

Caption

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 131

131

7/7/2013 5:20:03


1
2
3

1
2

Name

LblTitle1

Caption

Name

LblTitle2

Caption

Name

LblTitle3

Caption

Name

LblFullName

BorderStyle

1-Fixed Single

Caption

()

Name

LblSport

BorderStyle

1-Fixed Single

Caption

()

Name

LblMedal

BorderStyle

1-Fixed Single

Caption

()

Name

CmdStart

Caption

Name

CmdEnd

Caption

.
,
. OLE (Object Linking and Embedding) Visual Basic
Windows.

OLE .
, OLE .
.
.avi
. windsurf2.avi.
.
OLE, .
OLE :

OLE

132

Name
Sizemode
Visible

OLE3
2-Autosize
False

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 132

7/7/2013 5:20:03

OLE
Class
avifile SourceDoc .

.

. 11.8.
:
Private Sub CmdStart_Click()

If Option3.Value = True Then


lblFullName.Caption =
lblSport.Caption =
lblMedal.Caption =
OLE
OLE3.Action = 7
End If
End Sub
Private Sub CmdEnd_Click()
CmdStart_Click()
End
Visible
End Sub

OLE,
.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 133

133

7/7/2013 5:20:04

. 11.9.

,


.

Delphi
program Prj5;
uses
Forms,
Unit5 in Unit5.pas {FrmMain};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TFrmMain, FrmMain);
Application.Run;
end.
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
StdCtrls, ExtCtrls, MPlayer;
type
TFrmMain = class(TForm)
OptionGroup: TRadioGroup;
LblTitle0: TLabel;
LblTitle1: TLabel;

134

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 134

7/7/2013 5:20:04

LblTitle2: TLabel;
LblTitle3: TLabel;
FullName: TEdit;
Sport: TEdit;
Medal: TEdit;
CmdStart: TButton;
MediaPlayer1: TMediaPlayer;
Panel1: TPanel;
CmdEnd: TButton;
procedure CmdStartClick(Sender: TObject);
procedure CmdEndClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmMain: TFrmMain;
implementation
{$R *.DFM}
procedure TFrmMain.CmdStartClick(Sender: TObject);
begin
if OptionGroup.ItemIndex = 2 then
begin
Fullname.Text := ;
Sport.Text := ;
Medal.Text := ;
MediaPlayer1.Open;
MediaPlayer1.Rewind;
MediaPlayer1.Play;
end;
end;
procedure TFrmMain.CmdEndClick(Sender: TObject);
begin
close;
end;
end.

6
Visual Basic
Windows, Microsoft Excel.

Visual Basic
Visual Basic
, Dynamic Data Exchange (DDE).
DDE; Windows
.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 135

135

7/7/2013 5:20:04

DDE .
.
(destination)
(source).
DDE (topic).

(items) ,
.
. , Excel
(cells) .
Visual Basic DDE ,
, . Visual Basic, ,
, ,
DDE .
.
, Visual Basic
,
, .
, :
l

Edit
Paste Link.
, Visual Basic,
.
, Visual Basic ,
( ),
.

Visual Basic, , Visual Basic


Linkltem .
DDE (link) . ,

:
l

136

(automatic link):

(link item).
(manual link): .
(notify link):

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 136

7/7/2013 5:20:04

,
.
Visual Basic,
DDE, Hypermedia .
Visual
Basic Excel
.
( Visual Basic Excel), Excel,
prices.xls.
Visual Basic ( 11.10).

. 11.10. Excel
Excel Edit, Copy.
Visual Basic
Excel. , ,
. Visual Basic Edit Paste Link.
, Excel
Visual Basic ( 11.11).
, Excel
, Visual Basic ,
,
.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 137

137

7/7/2013 5:20:04


Excel. Linkltem

Visual Basic. , ,
LinkMode Automatic, LinkTopic
Excel
Picture Metafile,
Excel,
Visual Basic.

11.11. Excel Visual Basic


, Visual Basic Excel,
Excel ,
Visual Basic,
Visual Basic.
Excel
Visual Basic
Visual Basic.
Delphi, DDE Delphi
Windows
Clipboard. Delphi DDE
DDECIientConv DDECIientltem components.

138

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 138

7/7/2013 5:20:05

11.3. -
l

. , .

.
. ( , ..).
, , , .
, ,
. , , (tooltips), (toolbars),
(popup menus) (status lines).
.
.

. , , .
. .
.
.
, (keypress) (change).
. ,
( )
. ,
. :
-1_
-1. =

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 139

139

7/7/2013 5:20:05

:
-1_
...

...

l

. Visual Basic (Printer), (Clipboard), (Screen),


(App) (Recordset).
.
, .

.
.
, . Visual Basic
Popup.
(modal)
(modeless). . .

.
.
vbApplicationModal
vbSystemModal Msgbox.
SystemModal ,
ApplicationModal .
Visual Basic
. ,
0 ():
vo_p.Show 0

140

, ,
.
Height Width Left Top
.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 140

7/7/2013 5:20:05

11.4. -
1. .

2. ;
3. :
) .
) -.
4.
;

:
1. , 7, Fahrenheit
Celsius. Celsius
Fahrenheit : F=9C/5+32.
2. , 7,
. .
3.
.

1. .
.
;
2. .
.
3.
. , .
4. ( 4) , , (,
).
.
.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 141

141

7/7/2013 5:20:05

11.5.
1.

2.

1.  .
.

:
2. 
.
3. .
4. 
.
5. 
.
6. 
.
7.  .
.

3.

) .

)  .

)  -,
.

:
8. :

142

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 142

7/7/2013 5:20:05

9. 
:

10. :

4.

:
11.  -
______________ .
12.  _____________ .
13. ______________ .
14.  ____________ .
15.  ______________ .

5.

:
16.

17.

18.

19.

20.

1 1 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 143

143

7/7/2013 5:20:05

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 144

7/7/2013 5:20:05

12

12.1.

user interface, , . ,
(GUI). . ,
. ,
, ,
.

12.2. -
.
,
,
.
,

12.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 145

145

7/7/2013 5:20:05

,

.
.

. , animations,
. . ,
, .
,
,
.

,
.

12.3. -

1. ,

.
, ,
;
2.
. ( )
.

:
1. ,
:

3 .
l

1.  ,
2.  6 , - , , , , , ,

146

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 146

7/7/2013 5:20:05

3. ,
4. ,
5.  : , , .
l

1. ,
2. ,
3. ,
4. .

- .
.
-

1.
:
)  , ,
) 
,
)  (browser)
off line .
2. : ,
, , , , . .
3. 1.

12.4.
1.

. ,
:
1. , , ,

12.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 147

147

7/7/2013 5:20:05

2.

:
2. ________________ .
3.  ________________ .

3.

4.

:
4.

:
5. .
6. .
7. 
.

5.

:
8. :
)
)
)

6.

:
9. 
:

10. :

148

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 148

7/7/2013 5:20:05

13

13.1.
. , ,
. ,
.


.

13.2.
1

. Visual Basic
:


11

13  (..
)

1 3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 149

149

7/7/2013 5:20:06

Visual Basic
:
l

(form) ,

,
,

1
2
1
2

1
2
3

Name

FrmMain

Caption

Name

CmdDiv

Caption

Name

CmdEnd

Caption

Name

TxtNum1

Caption

()

Name

TxtNum2

Caption

()

Name

TxtNum3

BackColor

&80000018& (Tooltip)

Caption

()

Locked

True

Name

LblNum1

Caption

Name

LblNum2

Caption

Name

LblNum4

Caption

( 13.1).

150

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 150

7/7/2013 5:20:06

. 13.1.

.
.
Visual Basic :

On Error Goto label1:


label1. . ,
. ,
,
.
, .
Visual Basic
:
l

Resume:

Resume Next:

1 3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 151

151

7/7/2013 5:20:06

,

. ,
,

.
:
Private Sub CmdDiv_Click()
On Error GoTo Errorhandler:
Text.TxtNum3 = Text.TxtNum1 / Text.TxtNum2

Exit Sub
Errorhandler:
If Err.Number = 11 Then
Dim Response As String



Response 
= InputBox(
. . )
Text.TxtNum2 = Response
Text.TxtNum2.SetFocus



Resume

Elself Err.Number = 13 Then
MsgBox 

Text.TxtNum1 =
Text.TxtNum2 =
TxtNum1.SetFocus
Exit Sub
Else

MsgBox Err.Number & & Err.Description
Res
ume Next


End If
End Sub
Private Sub CmdEnd_Click()
End
End Sub

152

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 152

7/7/2013 5:20:06

InputBox
MsgBox ,

. :
InputBox( [, ] [, ] [, -] [, y-] [, , ])
InputBox
. , ,
, .

,
.
. ,
,
Number Description Err Visual Basic
. Err Visual Basic

.
, ,
.

. 13.2.

1 3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 153

153

7/7/2013 5:20:06

Delphi
program Errs1;
uses
Forms,
Err1 in Err1.pas {Form1};
{$R *.RES)
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
unit Err1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
TxtNum1: TEdit;
TxtNum2: TEdit;
TxtNum3: TEdit;
CmdDiv: TButton;
CmdEnd: TButton;
LblNum1: TLabel;
LblNum2: TLabel;
LblNum3: TLabel;
procedure CmdDivClick(Sender: TObject);
procedure CmdEndClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure Message1;
begin
ShowMessage( 
. .);
Form1.TxtNum2.SetFocus;
end;
procedure Message2;
begin
ShowMessage( 

);

154

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 154

7/7/2013 5:20:06

Form1.TxtNum1.Text := ;
Form1.TxtNum2.Text := ;
Form1.TxtNum1.SetFocus;
end;
procedure TForm1.CmdDivClick(Sender: TObject);
var
Num3 : Real;
begin
try
Num3 := StrToInt(TxtNum1.Text) / StrToInt(TxtNum2.Text);
TxtNum3.Text := Format ( %f , [Num3] );
except
on EZeroDivide do Message1;
on EConvertError do Message2;
end;
end;
procedure TForm1.CmdEndClick(Sender: TObject);
begin
close;
end;
end.

13.3. -
,

. , :
l


. , ,
.

,
.
.
.


. ,
.

1 3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 155

155

7/7/2013 5:20:06


.
.

,

.
.

,
.

13.4. -

1. .
2. .
3.
.

:
1. 11, .
2.
.

1.
.
2.
.

156

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 156

7/7/2013 5:20:07

13.5.
1.

:
1. .
2.  .
3. 
.
4. 
.
5. 
.

2.

:
6. :

7. :

3.

:
8.  ______________
.
9.  ______________
.
10.  , ______________ .

1 3 .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 157

157

7/7/2013 5:20:07

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 158

7/7/2013 5:20:07

14

14.1.

.
,
.
, ,
, .

14.2.
1
A(i,k) . . ,
.
.

.

14. -

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 159

159

7/7/2013 5:20:07

101
20
101
30
101
15
101
20
101
22
105
1
105
7
200
17
200
2
200
3
250
29
280
12
280
13
310
6
320
7
330
9

107
8

22
29
25
6
7
9

213

1 .
. . 1
, .
_

: A, GS, i, S, _

GS <- 0
i <- 1
S <- 0
_ <- (1,1)
i<1001
_<>(i,1)
_, S
GS <- GS+S
_ <- (i,1)
S <- 0
_
S <- S+A(i,2)
i <- i+1
_
_, S
GS <- GS+S
GS
_

160

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 160

7/7/2013 5:20:07

2
1 . , ,
n
. 2, 3,
4, ..., n-1. , n ,
n .

n
flag
i 2
_
n mod i = 0 flag
i i+1
_ flag=A i>n-1
// flag //

mod . ,
flag .

,
_ ...
i>n-1 i>(n).
, .
, 11 , 11 2, 3 .. 10,
4. 11 5,
6 .., 11/5,
11/6 ..., .

3
4,
100, 400. : 1984
( 4), 1900 ( 4 100), 1600
( 4, 100, 400), 1993 . .
.
.
E4 <- MOD 4
100 <- MOD 100
E400 <- MOD 400

14. -

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 161

161

7/7/2013 5:20:07

AN 4=0 TOTE
<- 1
_
AN 100=0 TOTE
<- 0
_
400=0 TOTE
<- 1
_
..

1, , 0, .
, .
,
.
,
.
, , .
. :
( )
/

(, )
(, )


/ .

. 2, . /
. ,
,
.
,
4, 100 400
. ,
8. ,
.
, :

162

mod 4 =0
E mod 100=0
mod 400=0

2
3
4
5

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 162

7/7/2013 5:20:07

1 4
, (.. 1: , 0: ).
, .
4 . 4 , mod
100 0, mod 400 0
.

14.3.
l

, ,
, .

.
. , .

() .
.

. ,
.

,
;

, VTOC, .

,
;

.
, . .

, .

, ,
. ,
.

, .
, .


. ( compiler), ,
.

14. -

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 163

163

7/7/2013 5:20:07

14.4.
1. . .

QQQ

: .
, +10. 10mod7=3,
3 , .
2. 3 . ,
().
.
: 1996, 1600, 2000 , 1500, 1998, 1900, 2006
.
3. 3
Q Q Q , , , , , , .
4. .
.
:
.

1. //
.
.
: 1.
2.
.


, , , , , , , ,
, , , , , , , ,
, , , , , , , , ,

=
=
=

3. , .

. :

QQQ

.
.
.
.
.

:
.

164

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 164

7/7/2013 5:20:07

/ .
.
4. .
.
.
.
: 2 3 .

1. 2, 2, 3, 3, 3, 3, 5, 6, 6, 6, 6, 6, 7, 8, 8, 8,
8, 8, 8, 9, 9, 9, 9, 9, 9.
.
, .
:

2
3
5
6
7
8
9

2
4
1
5
1
6
6

1
3
7
8
13
14
20

: A 1 .
2. 1
;
:

2
3
5
6
7
8
9

2
4
1
5
1
6
6

2
6
7
12
13
19
25

3. ( = = ). .
350 ..
.

14. -

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 165

165

7/7/2013 5:20:07

30 km.
,
, () . , ,
.
, .
().
: :

1
2
3
4
5

4. .
. .
.
5.
Q Q Q . :

V
5

10

L
50

C
100

D
500

1000

,
.

, ,
, .
R(1) R(2) R(3) R(4) R(5) R(6) R(7) R(8) R(9) R(10) R(11)

D
C
C
C

I
NULL NULL
C

V NULL NULL NULL NULL NULL

C
D
L

I
NULL NULL

C
D

NULL NULL NULL NULL

R(12)
NULL
NULL
NULL
NULL

=2803
=935
=1482
=1442

VTOC.
:
I. ,
. .. CD = 500-100 = 400, = 10-1= 9, XLV=+5+50-10 = 45.

166

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 166

7/7/2013 5:20:08

II. ,
. .. DC=500+100=600, LXV=+5+10+50=65.
:
.
I. : , V, , L, C, D, .
II. .
III. 2 ,
, , C, , 3. ..
LLV=+5+50+50=105 CV=+5+100=105, = 10+10+10+10=40
XL=+50-10=40, =+10+10+10.
IV. 2 , . . =+10-1-1=8 , VIII=1+1+1+5=8 , =999 , IIC=+100-1-1=98 , XCVIII=+1+1+1+5+100-10=98
.
V.
.
.. VLVM = 1000-5+50-5=1040 , MXL=+50-10+1000=1040 ,
CMXCVIII=+1+1+1+5+100-10+1000-100=998 .
VI. 2 .
.. LVM=1000-5+50=1045 , MXLV=5+50-10+1000=1045 ,
XLMVC=100-5+1000-50-10=945 , VLM=1000-50-5=945 ,
CMVL=50-5+1000-100=945 .
: MMDCCCIII=2803, CMXXXV=935, MCDLXXXII=1482,
MCDXLII=1442, .

14.5.
1.  euro
.
2. 
:


)
)
)

3.  :

)
)

)
)

4. , :

) T .
) T .

) T .
) N .

14. -

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 167

167

7/7/2013 5:20:08

5.  , :


) T .
) T .
) T .

) T .
) .

6.  123456.
( ):
1, 2, 3, 4, 5, 6, 7, 8, 9, 0.
7.  1 _
( -, -). .
___
___
___
___

_, S
GS <- GS+S
_ <- (1,i)
S <- 0

8. . (, )




) 
.
)  , ( 3, , , ).
) 
.
)  , , , .
)  .

9. :



)  .
)  .
)  .
)  .

10. :


)  .
)  .
)  .

11. :




168

) .
) 
.
) .
) .
) .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 168

7/7/2013 5:20:08

TURBO PASCAL
QUICK BASIC
VISUAL BASIC
DELPHI

- T U R B O PA S C A L

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 169

169

7/7/2013 5:20:08

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 170

7/7/2013 5:20:08

Turb o Pasc al
1.

1.2.3.

1.1.


CONST
,
..

Turbo Pascal
(0-9), (-)
(a-z), .

1.2.
1.2.1.
:
l (short integers) 1 byte
-128 127
l 2 bytes -32768
32767
l (long integers) 4 bytes
-2147483648 2147483647
l byte 1 byte 0 255
l word 2 bytes 0 65535
l 6 bytes 2.9e^-39
1.7e^38 11-12

l (real single
precision) 4 bytes 1.5e^-45
3.4e^38 7-8

l (real double
precision) 8 bytes 5.0e^-324
1.7e^308 15-16

l (extended)
10 bytes 3.4e^-4932
1.1e^4932 19-20

l comp 8 bytes
-9.2e^18 9.2e^18 19-20

1.2.2.
(string) 32767
.

CONST max_Item = 255;


Matr = array[1..max_Item] of integer;

max_ltem
255,
.


Turbo Pascal.

1.2.4.
(Boolean) , TRUE FALSE.

1.3.
( ,
).


.


. Turbo Pascal
. LETTER, Letter LeTTer
,
. . Turbo Pascal

. , . ,
,
,

, .. Matrixlndex, ArrayPointer ..
, .

- T U R B O PA S C A L

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 171

171

7/7/2013 5:20:08


:
- :
INTE
GER, LONGINT, SINGLE, DOUBLE, REAL, STRING,
CHAR, ARRAY, POINTER, RECORD, BOOLEAN
.
.. :
x : real;
x .

, . .. :
Mat1 : string;

0 32767 .
:
Mat1 : string[20];
20
.
Pascal .


.

.

Month={Jan, Feb, Mar, Apr, Mai,


Jun, Jul, Aug, Sep, Oct, Nov, Dec}
VAR
A, B:Month

,
. ..

StockItem = Record
Code : String[4];
Description
: String[20];
UnitPrice
: Single;
Quantity : Long;
End;
VAR
CurrentItem : StockItem;

,
-.-,

172

.. Currentltem.Code

CurrentItem.

1.4.

.
.


.
.
.. Mat[2,4], Table[j-1]
, ,
. ,
.

,
.
ARRAY.
(,).
.. Mat1 : array[1..50] of integer;

Mat1, 50
,
(integer).


.. array[-5..5] of integer; ,

-32768 32767.

(initialize).

.
(
).

.

QueueNode = Record

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 172

7/7/2013 5:20:08

Data : String[20];


=
<1> = <2>

QPtr : Integer;

End;
VAR

<>

Qnode : array[1..100] of QueueNode;

Qnode QueueNode.

-.-,
.. Writeln (Qnode.Data);

<

<=

>

1.5.
Pascal , (boolean)
.

AND, OR, NOT XOR, + (), - (), / (), * (), div
mod
. :

1 ()
2
3
4 ()

NOT, +,*,/,DIV,MOD,AND
+,-,OR,XOR
=,<>,<,>,<=,>=


,
. Turbo
Pascal

.
:

NOT
AND
OR
XOR

NOT <>
<1> AND <2>
<1> OR <2>
<1> XOR <2>

T


. .

>=



<1> < > <2>

<1> < <2> < 1>


<2>
<1> < = <2> <1>


<2>
<1> > <2> <1>


<2>
<1> > = <2> <1>


<2>

Pascal , :

ABS

INT

SQR

SQRT

SIN

COS

ARC

ARCTAN

LN

1.6.
Pascal
:
Program _;
( )
( )
( )
BEGIN

()
END.


.
. (;) Pascal

- T U R B O PA S C A L

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 173

173

7/7/2013 5:20:08

. . END
..
, ,

. ,

, .

CONST .
.. CONST Max = 100;
Max 100.
. .

_ = _;
.. TYPE MyArray = array[1..10] of integer;
MyArray 10

( ).

VAR _ : _;

.. VAR number : integer;



number .

VAR Arr1 : MyArray;

Arr1, MyArray.
Turbo Pascal . ,

VAR

. ,
:

MyArray = array[1..10] of integer;


VAR
Arr1 : MyArray;

174


. .
. .

, (;).
.

2.  ,
-

Pascal

. ()

(: =) .
..

uantity := 40;
q
message := File not found;
answer := Y;


quantity,
message,

answer.
,
.
.. x:=(3*y)/6;

z:=Sqrt(Sqr(x)+Sqr(x));


readln read. :
readln(vo_);
, .
readln read


read,
,
.. readln(var1);

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 174

7/7/2013 5:20:08


,
writeln write.
:
writeln(vo_);

.
, writeln,

, write,
.
.. writeln(varl);
varl
write(Turbo Pascal); Turbo Pascal .

.

:.

. ,
write :5, 5 .
10
write :5
10.
, ,
.
3.14156 write
:4:2 3.14

3.

. :
(sequence), (selection)
(loop). .

3.1.

, -

, .

.

,
;.

3.2.
3.2.1.

.
IF..THEN..ELSE.
:
IF THEN 1 ELSE 2
( )
: (true) (false)
. 1 2 . :
.
1, 2.
1 2
;.

1 2,
IF..THEN..ELSE,
(nested) IF.
ELSE ,
,

IF..THEN.
. () () 80 .
()
() 1.75 .


IF.
Write( : ) ; readln(b);
Write( : ); readln(y);
If (b<80) then
if (y<1.75) then
writeln( )
Else
writeln( );
Else
if (y<75) then
Writeln( )

- T U R B O PA S C A L

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 175

175

7/7/2013 5:20:08

Else
writeln( );

IF IF..
ELSE IF..ELSE, .

Writeln( : );
Readln(a);
If (a>0) and (a<=9) then
writeln()
Else if (a>=A) and (a<=z) then
writeln( )
Else if (a>=A) and (a<=) then
writeln( )
Else
writeln( );

Turbo Pascal IF ELSE IF




.

IF.

3.2.2.



,
CASE..END.
,
, IF..THEN..ELSE.



,
.
CASE..END IF..THEN..ELSE, .
:
CASE _ OF
__1 : 1;
__2 : 2;
.............
ELSE
_;
END;

176

.
,
-,
.

:.
,
ELSE.
CASE,
END
.
:

1
Writeln( 1 3 : );
Readln(number);
CASE number OF
1 : writeln( 1);
2 : writeln( 2);
3 : writeln( 3);
ELSE
Writeln( );
END;

2
Writeln( 1 20: );
Readln(number);
CASE number OF
1..10 : writeln(1 );
11..20 : writeln(2 );
ELSE
Writeln( );
END;


- _.
..,
.

3.3.


.
FOR..DO, WHILE..DO, REPEAT..UNTIL.

3.3.1. FOR..DO
FOR
BEGIN..END
.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 176

7/7/2013 5:20:08

FOR

.
FOR..DO ,

.
Write( :); readln(le);
Index:=0; ex:=0;
For i:=1 to 50 do
If cle=k[i] then
Writeln (I);

,
FOR..DOWNTO..DO.

.
,
. .

3.3.2. WHILE..DO

WHILE BEGIN..END,
WHILE.
, ,
WHILE..DO. k
cle
, .
Write( :); readln(cle);
i:=1;
While i<=50 do
Begin
If cle=k[i] then
Writeln (I);
i:=i+1;
End;

3.3.3. REPEAT..UNTIL
WHILE..DO
REPEAT..UNTIL.
REPEAT..UNTIL

( WHILE..DO).
, .

, .
,
,
REPEAT..UNTIL. k

cle
, .
Write( :); readln(cle);
i:=1;
repeat
If cle=k[i] then
Writeln (I);
i:=i+1;
until I>50

REPEAT...UNTIL
Write( ; (/) : );
REPEAT
Readln(a);
UNTIL (UPCASE(a) = )OR (UPCASE(a)=);


.
UPCASE
. () ()
. .

4. :




. ,
,

,
. Turbo Pascal
(procedures)
(functions).

,
:

- T U R B O PA S C A L

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 177

177

7/7/2013 5:20:08

1.
,
.
2.

.

(Units)

(Units).
, , ,

.
(compilation)
.
PROGRAM,
USES _1, _
2 ...
Turbo Pascal

(
).
CRT GRAPH.
CRT () ,
clrscr
Gotoxy()

, GRAPH
.

Program TEST
USES crt;
Begin

Clrscr;

gotoxy(10,10);

write ( )

........
end.

178

4.1.
.
, Begin
End
(;).
Turbo Pascal.

,

.
(local) (global) .


.
,
( ). ,
(compiler).
VAR

.

4.1.2.
PROCEDURE.

PROCEDURE _(_
_);
CONST
_1 = 1;
_2 = 2;
VAR
_1 : _1;
_2 : _2;
BEGIN
;
.............
END;

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 178

7/7/2013 5:20:09


.
__ ,
Turbo Pascal. . ,
__
.
.. PROCEDURE Display_Name( Title : String,
TLng : Integer );
CONST,
. VAR,


. BEGIN END,
.

. .
. a b x
, flag, 1 ,
0. Var
.
PROCEDURE EqSolve1(VAR a,b,x,flag :
Integer);
BEGIN
flag:=1;x:=0;
IF a=0 THEN flag=0
ELSE x:=-b/a;
END;


.
:
_ (__
);
.. EqSolve1( c, d, z, myflag );
,
(stack).

.


.
.

ArrType : array[1..10] of Integer;


PROCEDURE 
VectorSum( Var ArrName :
ArrType; n,s : Integer );
BEGIN
s:=0;
FOR i:=1 to n DO
s := s + ArrName[i];
END;


:
PROCEDURE _( _ : _ );
.. PROCEDURE VectorSum( VAR ArrName :
ArrType );

,

.
,
.
.. Vector( ArrName[3] );
.

. ,
, PrintRec.
TYPE StockElem = RECORD
Code : String[4];
Description : String[20];
UnitPrice : Single;
Quantity : Integer;
END;
VAR
StockRec : StockElem;
PROCEDURE PrintRec(VAR RecVar : StockElem);
BEGIN
.............
END;

- T U R B O PA S C A L

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 179

179

7/7/2013 5:20:09

BEGIN
.............
PrintRec(StockRec);
.............
END.


. SearchKey
Code.
PROCEDURE SearchKey(VAR CodVar:String[4]);
BEGIN
........
END;
BEGIN
..............
SearchKey(StockElem.Code);
..............
END.

To StockElem
.
StockElem, :
StockElem.Code, ,
StockElem.Description ,
...
Turbo Pascal

.
WITH _
DO. BEGIN END
,
..
WITH StockElem DO
BEGIN
Readln(Code);
Readln(Description);
Readln(UnitPrice),
Readln(Quantity);
END;

Pascal , .



VAR.

.

180


. , , Turbo Pascal
. ,
,
.
,
, .


, .
.

.


. D test
,
.
.....
Procedure test(C:integer, Var D:Integer);
Begin
C:=C*C;
D:=D*D;
End;
......
A:=10;
B:=20;
test (A,B)
Write (A,B)
....

To : 10 400

4.2.
.

,
. , (user-defined functions)

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 180

7/7/2013 5:20:09

. , FUNCTION.
, , ,
.
Turbo Pascal (recursive call) -
.
,
.
,

.

4.2.2.
FUNCTION.
:
FUNCTION _ (__) : _
_
.
.

. ,
.
,
,
.
.. FUNCTION
Func1(a : integer) : Longint;
:
a : = Func1(variable1);
a
Longint
.

BEGIN END.

.
.
FUNCTION MKD(a,b : longint) : longint;
BEGIN
writeln(a:10, b:10);

while b<>0 do
begin
c := a mod b;
a := b;
b := c;
writeln(a:10, b:10);
end;
MKD := a;
END;

.
,
.
MKD:=a. , .
,

.

4.3.

,
.
(recursive).
n! ().
n :
n! = n*(n-1)!
0! = 1
.. n=5 5! = 5*4*3*2*1 =120
Fact
n! :
PROGRAM Fact1;
VAR
number : longint;
FUNCTION Fact(n : longint) : longint;
BEGIN
IF n=1 THEN
Fact := 1
ELSE
Fact := n * Fact(n-1);
END;
BEGIN
write(

1 20 : );
readln(number);

writeln(To
,number:2, ,Fact(number));
END.

- T U R B O PA S C A L

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 181

181

7/7/2013 5:20:09

Q uic k B asic
1.
1.1.
QuickBASIC
(QB) (0-9), , (-)
(a-z), .

1.2.
1.2.1.
:
l 2 bytes -32768
32767.
l (long integers) 4
bytes -2.147.483.648
2.147.483.647.
l (real single
precision) 4 bytes
1038 6-7 .
l (real double
precision) 8 bytes
10308 15-16 .

1.2.2.
(string) 32767
.

1.3.
( ,
).
40
.
. QB
. NUMBER,
number NumBeR
, . . . ,
.
, .. InventoryItem,
StockElement ..
, .
.
1.
.

1.2.3.

% , .. a%, Delta%

CONST
. ..

& , .. a&, Value&

CONST MaxElem% = 255

MaxElem
255.


QB. %,
&, !, # $
, . -

182


DEF.

! , .. a!, Sum!
#  , .. a#,
Total#
$ , .. a$, Nam$

, a%, a&, a!, a# a$


.
a (by default)
.
2. :

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 182

7/7/2013 5:20:09

- AS

1.4.

..


.
.

.
. ..

DIM,
COMMON, REDIM, SHARED STATIC
INTEGER, LONG, SINGLE, DOUBLE,
STRING .
DIM x AS LONG

x .

, . ..
DIM Nam1 AS STRING


0 32767 .

DIM Nam2 AS STRING*20

20
.
,
. ..
TYPE Stocktem
Code
AS STRING * 4
Description AS STRING * 20
UnitPrice
AS SINGLE
Quantity
AS LONG
END TYPE
DIM Currenttem AS Stocktem


-.-,
.. Stockltem.Code

Stockltem.
(.)

.
3. DEFINT,
DEFLNG, DEFSNG, DEFDBL DEFSTR , ,
, .
. DEF
.
..
DEFINT -

(3), Array(5,8), Nam$(20)

,
.
,
.

,
. DIM.
60
32767.
DIM,
10. DIM
, , .. DIM (100).
-,
, ..
DIM (1 100).

, .. DIM (-5 5).

-32768 32767.
DIM
null.

.
(
).

. ..
TYPE QueueNode
Data AS STRING * 20
Pointer AS INTEGER
END TYPE
DIM Q(100) AS QueueNode

- quick basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 183

183

7/7/2013 5:20:09

Q
QueueNode.
- . - , ..
PRINT Q(i).Data

1.5.
, , ,
.
\.
AND,
OR NOT. +
(strings) .
QB , .. (. ).

ABS

COS

EXP

ex

FIX

INT

LOG

RND

SIN

SQR

TAN

1.6.
QB (modules).
(source file),
.
.
. .

. -

184


.
.
:
REM , COMMON, CONST, DATA, DECLARE,
DEF , DIM, OPTION BASE, SHARED,
STATIC, TYPE...END TYPE.

,
- :.
.
256
.

2.  ,
-
:
=

QB = , () .

.
SWAP a,b
.

:
INPUT [{;|,}] _

, , . ..
INPUT T=,Value


;, , , ,
.
Enter. _,
.
LINE INPUT a$ ,
.
Enter.
INPUT $ (n) n ,
Enter. ..
z$=INPUT$(1)

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 184

7/7/2013 5:20:09

$
,
(. 3.3.3.).
READ _, DATA. ..
READ a,b,c
DATA 10,-5,3000

READ

.


READ-DATA, .
INPUT.

PRINT _


.

_. ,

14 . ,
.


PRINT USING ; _


, (. ).
LPRINT LPRINT USING
.

3.

. :
, .
.

3.1.

, .

.

,
- (:).

3.2.


GOTO. GOTO,
,
GOTO . GOTO
(label).
GOTO , .

. QB GOTO,
.

3.2.1.

.
IF..THEN..ELSE.
:
IF THEN E1 ELSE 2

( )
: (true), , (false),
. 1 2 . :
. ,
1, 2.
1 2
:. 1 2,
IF..THEN..ELSE, IF. -

- quick basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 185

185

7/7/2013 5:20:09

ELSE , ,
,
IF..THEN.
IF..THEN..ELSE

255 .
. () () 80 .
()
() 1.75.

IF.
INPUT =,
INPUT =,
IF <80 THEN IF <1.75 THEN PRINT
ELSE PRINT
ELSE IF <1.75 THEN PRINT
ELSE PRINT

, QB
IF..THEN..ELSE,
.
(block)
IF, 1
2
.
,
, END IF,
. IF
:
IF <80 THEN
IF <1.75 THEN
PRINT
ELSE
PRINT
END IF
ELSE
IF Y<1.75 THEN
PRINT
ELSE
PRINT
END IF
END IF

.

,

.

186

IF..THEN..ELSE
,
ELSEF, .
..
INPUT :,a$
IF a$>= 0" AND a$<=9" THEN
PRINT
ELSEIF a$>= A AND a$<=z THEN
PRINT
ELSEIF a$>= A AND a$<= THEN
PRINT
ELSE
PRINT
END IF

IF, ELSEIF ELSE


,

IF, ELSEIF ELSE. QB
.
QB IF
ELSEIF

.

END IF.

3.2.2.

.
SELECT..CASE.
, ,
IF..THEN..ELSE.
SELECT..CASE IF..THEN..ELSE

,
.
SELECT..CASE
IF..THEN..ELSE,

.
:
SELECT CASE
CASE --1
-1
CASE --2
-2
...............

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 186

7/7/2013 5:20:09

CASE ELSE
-
END SELECT

. - ,
-
.

CASE .

,
CASE ELSE.
CASE, END
SELECT.
.

1
INPUT
SELECT CASE i
CASE 1
PRINT
CASE 2
PRINT
CASE 3
PRINT
CASE ELSE
PRINT
END SELECT

1 3 : , i
1"
2"
3"

2
INPUT 0 9 : , i
SELECT CASE i
CASE 0
PRINT
CASE 1,3,5,7,9
PRINT
CASE 2,4,6,8
PRINT
CASE ELSE
PRINT 9
END SELECT

-
.

3
INPUT 1 20 : , i
SELECT CASE i
CASE 1 TO 10
PRINT 1
CASE 11 TO 20

PRINT 2
CASE ELSE
PRINT
END SELECT

- -,
.

4
INPUT
BASIC ; ,age
SELECT CASE age
CASE IS<0
PRINT
CASE IS<5
PRINT !
CASE 5 TO 80
PRINT
CASE IS>80
PRINT .
CASE ELSE
PRINT
END SELECT

IS
.
CASE IS<5 age<5.
BASIC,
. < , < = , > , > = , < > =.
, , .
0 5, CASE IS<0.
CASE,
.
CASE -1, 0, 10 20, 50 90, IS>99
CASE i, j, k, -1 TO 1
CASE IS<A, IS>z
CASE TO , , , , 
, ,
,

3.3.


.
FOR-NEXT, WHILE-WEND DOLOOP.

- Q U I C K B A S I C

22-0204 ANAPTIXI EFARMOGON TETRADIO 145-240.indd 187

187

4/28/14 2:14 PM

3.3.1. FOR-NEXT
FOR
NEXT .
FOR
,
. ,
1, . QB
,

EXIT FOR. FOR-

k$().

cle$, EXIT
FOR.
INPUT : ,cle$
index = 0 : ex = 0
FOR i = 1 TO n
IF cle$ = k$(i) THEN
index = i : ex = 1 : EXIT FOR
END IF
NEXT i


index, ex 1 .

3.3.2. WHILE-WEND
WHILE
WEND
WHILE.
WHILE
, .
, .
OPEN ,#1,"SEQFILE.DAT"
WHILE NOT EOF(1)
LINE INPUT#1, Rec$
PRINT Rec$
WEND
CLOSE

3.3.3. DO-LOOP
WHILE-WEND
DO-LOOP.

DO LOOP.

(WHILE)
(UNTIL).

188


.
EXIT DO. ,
.
EXIT DO.
DO-LOOP
.
.

1
z$="
"
DO UNTIL LEN(z$)<>0
z$ = $
LOOP


. .

2
z$ =
DO WHILE LEN(Z$) = 0
z$ = INKEY$
LOOP


. .
.

3
DO
INPUT (/) : ; z$
z = INSTR(NOvo,z$)
LOOP UNTIL z<>O


. ,
, .
.

4
i% = INT(RND(1)*10)
j% = INT(RND(1)*10)
DO
PRINT i% ; * ; j% ; =;
INPUT ,k%
LOOP WHILE k%<>i% * j%

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 188

7/7/2013 5:20:09


i% j%.
, .
.

5
s = 0
DO
INPUT x
IF x = 0 THEN EXIT DO
s = s + x
LOOP

.
,
.

.

WHILE, UNTIL.
, ,
.

4. :



.
,
,
,
. QB

, (procedures).

(subprograms) (functions).

4.1.


.
,

.

, .

(subroutine).

GOSUB. RETURN.

,



SUB END SUB.
:
1.  (local) (global)
.



.

.
, (by default).
.


.
2. 
,

.
.
.

4.1.2.
SUB.
:
SUB -
[(
)] STATIC

- quick basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 189

189

7/7/2013 5:20:10

_
40
SUB .
l _ ,
. .
l STATIC
. , , .

. ,
null
. (automatic).

:
l

END SUB

SUB END SUB


.
QuickBASIC
:
l (userdefined functions)
(DEF FN...END DEF, FUNCTION...END
FUNCTION).
l SUB ... END SUB.
(nested subprograms).
.
.
ax+b=0. a b
x, , flag,
1, , 0.

:
l _
.
l _ ,

.

CALL
SUB.
.
CALL .
END SUB,

CALL.

EXIT SUB.
,
EqSolve1
3+2=0 :
CALL EqSolve1 (3,2,x,flag)

CALL.

,
. :
EqSolve1 3,2,x,flag

4.1.4. 
CALL
, , ,

CALL.

SUB EqSolve1 (a,b,x,flag) STATIC


x=0 : flag=1
IF a=0 THEN flag=0 ELSE x=-b/a
END SUB

. CALL a
b.

4.1.3.


a = 5 : b = 0
PRINT , :;
PRINT a =; a, b =; b
CALL Square (a,b)
PRINT , :;
PRINT a =; a, b =; b
END

CALL.
CALL QB,
ASSEMBLY.
CALL :

190

CALL -
[(
)]

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 190

7/7/2013 5:20:10

SUB Square (x,y) STATIC


y = x * x
PRINT , x =;x;" y =";y
END SUB

To :
, :
a = 5
b = 0
, x = 5 y = 25
, :
a = 5
b = 25

b
y SUB.
Square, y 0. y ( 25)
.


(by reference).

.

.
,
.
,

,
. .
(by value)
. ,
CALL Square (a,b) CALL Square(a,(b)) b 0.
Square
b.
y


b.
:
, :
a = 5
b = 0
x = 5 y = 25
, :
a = 5
b = 5

:
CALL Prog2(x,(y+1))

.
. .
.
.

,
S.
SUB VectorSum (x(l),n,s) STATIC
s=0
FOR i=1 TO n
s=s+x(i)
NEXT i
END SUB

CALL
:
CALL - 
(
())

..

CALL VectorSum (x(),n,s)

,
.
,

CALL.
..

CALL Prog1 (Array(3,9))

4.2.
.
, ,
.
, (user defined
functions) .

4.2.2.
FUNCTION.
:
FUNCTION _
(_) STATIC

_ 40
/ .

- quick basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 191

191

7/7/2013 5:20:10

STATIC
.

END SUB. FUNCTION END SUB


.
EXIT SUB.
.
y=(x)/x.
FUNCTION y (x) STATIC
IF x<>O THEN
y=SIN(x)/x
ELSE
y=0
END IF
END FUNCTION

4.2.3. 

FUNCTION
BASIC, .
.
:
INPUT =,x
PRINT y(x)

,
.
, ,
, .

.

. , ,
,
.

4.3. 
SHARED

CALL,
QuickBASIC

:

192

1.
 SHARED COMMON
DIM

, . .
. SHARED,
SHARED COMMON
DIM :
COMMON SHARED a,b,c
DIM SHARED Array(10,10)

, AS, ..
DIM SHARED i AS INTEGER

, . i DEFINT,
COMMON [SHARED] i
.
2.
 SHARED

SHARED.

. SHARED :
SHARED _

SHARED :
a = 1 : b = 2
CALL Prog2
SUB Prog2 STATIC
SHARED a,b
c = a + b
PRINT c
END SUB

4.4.


, .
. QB .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 192

7/7/2013 5:20:10

n! (n ).
n :
n! = n . (n-1)!
0! = 1
.. n = 5 => 5! = 5.4.3.2.1=120
Fact
n! .
DECLARE FUNCTION Fact# (n%)
INPUT 1 20 :, n%
PRINT n%,Fact#(n%)
END

FUNCTION Fact#(n%) STATIC


IF n%>0 THEN
Fact# = n% * Fact#(n%-1)
ELSE
Fact# = 1
END IF
END FUNCTION


.

(stack) ,
.

,

. Out of stack
space. To

CLEAR,,.
,
.

4.5.

DECLARE
,
QB
DECLARE
.
DECLARE, SUB FUNCTION,
.
,
, .
DECLARE

SUB FUNCTION.

- quick basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 193

193

7/7/2013 5:20:10

Visual B asic
1. 
VISUAL BASIC. ................ . . . . . . . . . . . . . . . . . 194
1.1. To ........... . . . . . . . . . . . . . . . . . 195
1.2. .................. . . . . . . . . . . . . . . . . . 196
1.3. ...................... . . . . . . . . . . . . . . . . . 197
1.4. . ........... . . . . . . . . . . . . . . . . . 199
1.5. O ........ . . . . . . . . . . . . . . . . . 200
1.6. o ......... . . . . . . . . . . . . . . . . . 201
1.7. .. . . . . . . . . . . . . . 202
2. 
............ . . . . . . . . . . . . . . . . . 202
2.1. 
. . .................... . . . . . . . . . . . . . . . . . 202
2.2. 
. ................. . . . . . . . . . . . . . . . . . 203
2.3. 
. .................... . . . . . . . . . . . . . . . . . 205
3.  . . . . . . . . . . 206
3.1.  Visual Basic .. . . . . . . . 207
3.2. . ............... . . . . . . . . . . . . . . . . . 207
3.3. . ................................ . . . . . . . . . . . . . . . . . 209
3.4. ............................ . . . . . . . . . . . . . . . . . 209
3.5. ............. . . . . . . . . . . . . . . . . . 211
3.6. . . . . . . . . . . . . . . . . . 212
3.7. . ............. . . . . . . . . . . . . . . . . . 212

Visual Basic

Windows.


Windows.
Visual Basic

194

4.  . . . . . . . . . . 212
4.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
4.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
4.3. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
4.4. Clipboard.. . . . . . . . . . . . . . . . . . 214
5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
5.1. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
5.2. . . . . . . . . . . . . . . . . 215
5.3.  . . . . . . . 216
6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
6.1. . . . . . . . . . . . . . . . . . . 216
6.2. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
6.3. 
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
6.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
6.5. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
6.6. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
6.7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
7. (MULTIMEDIA). . . . . . . . . . . . . . . . . . . 221
7.1. Multimedia Visual Basic. . . . 221
7.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
7.3. (animation). . . . . . . 223
7.4. Video. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

,
Windows.

Visual Basic
.

1. 

VISUAL BASIC

Visual
Basic. Visual Basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 194

7/7/2013 5:20:10

Visual Basic
( 1).

Visual Basic.
Windows.
, , Visual Basic.

Windows.
, (Control Menu Box)
, (Minimize, Maximize
buttons & Close buttons).

. 1. 
Visual Basic
Visual Basic Windows
.
Visual Basic

,

.
Visual Basic
:
l Visual Basic.
l (Form).
l (Toolbox).
l (Project Explorer).
l (Properties Window).
l To (Form Layout
Window).

To
.
, ,
(Access Keys),
Alt .
,

. ,


(shortcut keys),
.

( 3). (groups) .

1.1. To
Visual Basic ( 2),
(Title
bar), (Menu bar)
(Toolbar).

. 2. To Visual Basic

-

. 3.
(Toolbar)
, .

,
.
,
(Tooltips) .

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 195

195

7/7/2013 5:20:10

1.2.
Visual Basic
(form).
Visual Basic. , Visual Basic
( 4).
Visual Basic . (user
interface)
.
-
.
,
Visual Basic,

.

. 4.
Visual
Basic,
,
Windows.

.

,
.


. ,

196

.
,



.
,
.


.

(Grid)
.
,

Visual Basic
. ,



, Show Grid=No
Width Height General
Options Tools Visual
Basic. , Align Controls To Grid
.
Visual Basic .
, .
. , ,
... ,
, ,
.

Visual Basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 196

7/7/2013 5:20:11

. ,

Visual Basic

.
, Run Visual Basic Start
F5 .
Visual Basic
(run mode), [run] .




Windows.




. ,

, .

End Run

Visual Basic.
Visual Basic.

Visual
Basic ,


, .


.
Basic
(.. BackColor
), Visual

(.. Move
).

1.3.
(Toolbox)
Visual Basic ( 5).

(icons) controls.

. 5.
Visual Basic.
- (user interface).

.


.
, Visual Basic,
.

.

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 197

197

7/7/2013 5:20:11

,
Visual Basic

.

Windows

.

Visual Basic , (intrinsic controls), ActiveX


(insertable objects). , Visual Basic
.
, .

Visual Basic.

198

(Pointer):

.
(cursor)


Visual Basic.

.
(Picture box):
.
(icons) .ICO, (bitmaps) .
(metafiles) Windows
.WMF .EMF.
(Label):

.

.
Visual Basic .
(Text box):
,
.

(Frame):

.
,

.
(Command button): ,


.
(Check box):

(- On-Off ).

.

.
(Option button): .


, .
(Combo box):
.

.
(List): ,

.

.

(Horizontal and Vertical scroll bars):

.



.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 198

7/7/2013 5:20:11

(Timer): .

, .
.
(Drive list
box):
.
,
Visual Basic.
(Directory
list box): .
(File list
box): .
(Shape):

.
, , ..
(Line):

.
.
(Image): ,

. , .
(Data):
Visual Basic
. Visual Basic
(bound controls).
(Grid):
Excel.
.
OLE (OLE Container): -

Visual Basic ,
OLE
Windows.

1.4.
Visual Basic

, ActiveX ,
(insertable objects)
.
Visual Basic ActiveX
.OCX.
.VBX. OCX ActiveX OLE (Object Linking and
Embedding)
32- 16-
Visual Basic. VBX
,
16- Visual Basic
.
Visual Basic
VBX , Visual Basic
OCX
.
, ,

(.. Excel)
Visual Basic.

ActiveX .

OLE Automation

Visual Basic .
ActiveX
Visual Basic .
ActiveX
, Components
Project Visual Basic.

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 199

199

7/7/2013 5:20:11


Components ( 6).

. 7.

. 6. To Components
,


OK.
Visual Basic.
ActiveX
,
(instances) .
Components,


. ,

,
.

1.5. O
Visual Basic
.

Visual Basic,
(Project). ( 7)
.

200


,
Project Explorer View.
Visual Basic
.



(Project file).

(references) , , .


Visual Basic :
l (Form modules):
,
,
.

Visual Basic

.FRM.
l (Standard modules): , ,
,

Visual Basic. .BAS.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 200

7/7/2013 5:20:11

(Class modules):
.
,
.


, . .CLS.
(Resource file): Visual Basic
4.0

.
.RES
(.. bitmap
), .

,


.

1.6. o
(Properties window)
Visual Basic
( 8)
(, , ),
.

(..
) (..

).


.

Visual Basic
Windows.

. 8. To

, View
Properties Window F4
.

,

Visual Basic.

Windows
(Object box)

.
,
.
,
.

, (Alphabetic)
(Categorized). , (Properties list),

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 201

201

7/7/2013 5:20:12

. ,


(Settings box).
,
,
.

Visual Basic

,

.

1.7.
(form layout
window)

( 9).
,

.

. 9.

2. 


Visual Basic.
Visual Basic

DOS
Windows.

Visual Basic,

202

.

, , .

2.1. 



.
Windows

.
.

Windows .


-. .
Windows Visual
Basic,

.


, (message)
(event),

-.

,
.


,



.
-

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 202

7/7/2013 5:20:12


Visual Basic :
l

-.


- .
,
,

.
Visual Basic
(structural)
(modular).

,
DOS,
.

,
(object-oriented)
(event-driven)
.
Visual Basic.

2.2. 

, (Object-Oriented
programming)
,
.
.

.
Visual Basic Windows
,

.
Visual Basic. .
,
, ,
.. ,
(.. )
(..
).
(..
).
Visual Basic.



.

.


. Visual Basic.

, ..


,



,
.
Visual Basic
. Visual Basic
.
.
(instances) .

,
.

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 203

203

7/7/2013 5:20:12

(.. ), .
(properties) (methods).


.

Visual Basic.
. , (Form)
AutoRedraw, BackColor, BorderStyle,
Caption, Font, Name ..
,
.

. , , (command button)
,
,
, ..
(Properties window) Visual Basic.

.

,

. ,

Caption (). Caption
, :
Form1.Caption =

,
:
_! _.
(methods).

,
.

204

. ,

(List)
Addltem, :
List1.Addltem
Visual Basic

.

Visual Basic.
(Text box)
Clipboard SetText:
Clipboard.SetText Text1.Text
,
Windows.

API Windows. ,
, Visual Basic
,
,
, .

Windows (.. Word) (DDE Link)
LinkSend:
Picture1.LinkSend
Visual Basic
.



.
Visual Basic
:
l . , ,

.
l (controls)
. Visual Basic :

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 204

7/7/2013 5:20:12

Visual Basic
, .
Clipboard, Debugger,
. Visual Basic .

, . ,

Clipboard, ,
.
(Database ob
jects).
.
(Classes). Visual Basic


,
,
. Visual Basic,
,
.

.


.

. Visual
Basic ,
.

2.3. 

,

. ,

.


Visual
Basic,
.
,
Keypress ,
, Timer ,

Load.

Visual Basic .
,

.

Visual Basic.
Visual Basic
,
.

, (event procedures).

. ,


(Load) .
:
Sub Form_Load().
Visual Basic




. Visual Basic
,
,

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 205

205

7/7/2013 5:20:12

Visual Basic
(Events).
(Check box),
, :
Click KeyDown KeyUp KeyPress
DragOver DragDrop GotFocus LostFocus

, Visual
Basic (code window)
.
.

,
.
Visual Basic .
.
,
Visual Basic
.
,
. ,


.
. ,
,

Text
. trigger events.


. , Dblclick ( )
, Click, MouseDown

206

MouseUp. Visual Basic


.

,
:
1. .
2. .
3.
, .
4. , .
5.
.


. cascading
event ,
Visual Basic (Out of stack
space error). , ,
Text,

.

3. 

Basic
DOS Visual
Basic,
. , Visual Basic

.
,
Windows

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 206

7/7/2013 5:20:12

, .
Basic
DOS
.
,
, .
.
, Visual Basic
.
Visual Basic
Basic (. QuickBasic) .

.
,
, ,
.


Visual Basic ,

.

3.1.
 Visual Basic

Visual Basic
,
Windows.
Visual Basic
,
()
.

, Visual Basic,
:
l

(Data
Input)

( ),

(Data Output)


. ,
Visual Basic

.
,
(controls)
.

DOS
Visual Basic.

Visual Basic

,

.

3.2.
, Visual
Basic

.


.
Visual Basic
.
-

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 207

207

7/7/2013 5:20:12

.
Visual Basic

.
,

-,
. ,



.
Visual Basic

,
(modules).
. (standard modules)
(form
modules) (class modules). , ,

.

.

3.2.1.
(, ) (Declarations section).

(Declarations).

(..
) ,
, DLL .

3.2.2.
Visual

208

Basic

(procedures).
, .

, .

.
Visual Basic
:
l

Sub

Sub . Sub

Sub
End Sub.
(general
procedures) (event
procedures).

,
.


.
,
.

,

.
, .
l

Visual Basic
(Function procedures),

, Sqr

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 208

7/7/2013 5:20:12

Chr.
.
l

(property procedures)

.
,
.
. ,
(read-only)

.

3.3.
Visual
Basic,
.
.
Visual Basic
(Constants) .

.

.
Visual Basic,
Visual Basic .

(bject
Browser)

Paste,
.
Visual Basic
, .

, Const:
[PrivatePublic]Const _[As _]=

,
:
Const PI = 3.1415
Const Dealer =
Const HireDate = #1/3/92#

Visual Basic

:
l , Const
.
l
, Const
(Declarations section)
.
l , ,
, Const
Public
(Declarations section)

(standard module):

Public Const Pi=3.14


Const.

3.4.

.
Visual Basic

.
,
Visual Basic (. Sub End) 255 . Visual Basic

(String) ,
(Numeric) -

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 209

209

7/7/2013 5:20:12

,
(Logical) (True) (False),
(Date) (Object)
.
Visual Basic,
( 1),
, .


.

(Integer)

(Long)

.
bytes

-32768 +32767

-2,147,483,648
2,147,483,647

( )
-3.40282338
-1.401298-45

4
( )
(Single)
1.401298-45
3.40282338
( )
-1.797693134862313
08
-4.94065645851247
324

8
( )
(Double)
4.94065645851247-3
24
1.7976931348623
1-308
-9.22337203685477.58
08

8
9.22337203685477.58
(Currency)
07
0 65000
1 byte/
(String)
. 0 232 32bit

1
0 255
(Byte)

2
True False
(Boolean)
January 1, 100 to

8
December 31, 9999
(Date)

4

(Object)

1: Visual Basic

210

,
Visual Basic
, Variant.
Variant, .

Variant
(format), . Variant
16 bytes
1 byte
. Visual Basic,
, . Variant ,
,
. , (+)
,
.

, Visual Basic
Variant. , ,

, . ,


, Integer,
bytes .
,

Visual Basic Option
Explicit. Option Explicit ,

.

Option Explicit,

,
. ,

.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 210

7/7/2013 5:20:13

3.5.
Visual Basic
(scope).


.
Visual Basic


.
Visual Basic :
_ As _.

,
.

1. Variant.
Visual Basic
, .
l

(Iocal variable)

( )
.

.
.
.


.
Dim.
Dim
:
Dim Total As Long
Dim Test As Integer, Name As String

, ,
.
,
Static :
Static Flag As Integer
Static ,
.
l

, ,
.
(module-level variable)

.


, .
,
Dim Private. (Declarations
section) :
Private Counter As Integer

Dim Counter As Integer


Private,

.
l

Visual
Basic .
(public variable) .
(Declarations

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 211

211

7/7/2013 5:20:13

section), ( ) Public:
Public LastName As String

3.6.
(Decision structures),

Visual Basic.
Visual Basic
.
,


.
, .
Visual Basic :
l lf...Then
l lf...Then...Else
l Select Case
Visual
Basic
QuickBasic.

3.7.
(Loops)


. Visual Basic :
l For...Next
l For Each...Next
l Do...Loop
Visual
Basic
QuickBasic.

4. 

,
Visual
Basic .

212

-
(graphical user interface)
Basic DOS.
,
Visual Basic
,
.
Visual Basic .


,
, (error handling),
(graphics),
( DDE OLE)
..
Visual Basic,

.

4.1.

(menu). ,
,
.
Visual Basic,
.

Visual Basic,
.
Visual Basic

Windows-based ,
, (access
keys), (shortcut keys) ..
(Menu Editor) Visual Basic
( 10). , Tools
Menu Editor Menu Editor
.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 212

7/7/2013 5:20:13

(menu
control list box)
.

4.2.

. 10. Visual Basic


, (menu items).

Visual Basic

Visual Basic,

click.

.

click .

. , ,
(menu
control properties).
,

. Name
Caption
. Name


Visual Basic Caption
.


.
,

Visual Basic (dialog boxes).

,
.
Visual Basic,
:
l ,
.
l (standard dialog boxes), Common dialog ActiveX control
Visual Basic,
.
l
lnput()
MsgBox().
,
Visual Basic. Visual Basic
, MsgBox()
InputBox() .

,

Visual
Basic. ,

.
Visual Basic
:
l (modal),

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 213

213

7/7/2013 5:20:13

.

,
.
(modeless),

.
,
.

s.

4.3.
Visual Basic
Windows,
, Truetype
, ..
,
Windows
, .

,
(printer driver)
.

Visual Basic .
,
Visual Basic ,
:
l PrintForm.
l ,
(Printers Collection).
l
Printer Visual Basic Print NewPage EndDoc .

214

4.4. Clipboard
Visual Basic , Clipboard
Windows. Clipboard
,
. Clipboard
Windows.
Windows
Clipboard,
.


Windows,
Clipboard.

Clipboard,
Clipboard
Visual Basic. To Clipboard

Clipboard.

SetText GetText
SetData
GetData .
,

Clipboard
.
.


,

.
SelText
.
SelLength .
, SelLength
.

TxtEntry Clipboard,
SetText
Clipboard:

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 214

7/7/2013 5:20:13

Clipboard.SetText TxtEd.it.SelText

Clipboard
GetText
Clipboard:
.TxtEdit.SelText = Clipboard.GetText


Clipboard .
(GetData, SetData)
.
,
Clipboard :
Clipboard.Clear
Clipboard
,
.

5.
Visual Basic

. Visual Basic
. Access, Excel,
Btrieve, dBase, FoxPro, Paradox ..
,
Visual Basic,
.


. To recordset
.

5.2.
5.2.1. Connect
Connect


(.. password).

5.2.2. DatabaseName
DatabaseName

.
Visual Basic
remote , server
.
.

5.2.3. Exclusive

, ,
Exclusive True.
.
, ,
.

5.1.

5.2.4. Options


,
(data control) ( 11).

Options, ,
.


.

. 11.

5.2.5. Readnly
Visual
Basic (recordset).
recordset object

Visual Basic ,
,
,
Readnly True.

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 215

215

7/7/2013 5:20:13

5.2.6. RecordSource
RecordSource


Visual Basic.
.

5.3. 

(Bound Controls)
,


. , Visual
Basic
.

Visual Basic,

.
Visual Basic [ (image), (label),
(picture box), (text box), (check box), (DBList),
(DBCombo) ..]


.

:
l DataField:
.
l DataSource:
.

6.
Visual Basic .
.
, , ,

216

6.1.


.

, , .
(x,y). x

x y y.
Visual Basic
:
l
. ,

,

.
l

. ,
,
,
.
l

twips.
l (0,0). ,
,
(0,0).
l
.
Visual Basic
.

, .

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 216

7/7/2013 5:20:13

6.2.
Visual Basic ,

twip. twip 1/20
1440 twips
.
.
,
, .

6.3. 

, :
l
, twips
l
Visual Basic
l .
, ,
ScaleMode.
, , ,
2.

0 - User



ScaleHeight, ScaleWidth,
ScaleLeft ScaleTop
.
1 - Twip
,
567 twips = 1 cm.
2 - Point
1 inch = 72
(points).
3 - Pixel
pixel

.
4 - Character 1
(character)
,
120 twips
240 twips.
5 - Inch
, 1 inch = 2,53 cm.
6 - Milimeter .
7 - Centimeter .
2:
ScaleMode


( 0) ScaleMode, Visual
Basic
ScaleWidth ScaleHeight,
.
ScaleTop ScaleLeft.
CurrentX
CurrentY, .

ScaleHeight, ScaleWidth,
ScaleLeft ScaleTop.
, .
,
0 ScaleMode.
,

,
(0,0).
Scale
ScaleHeight, ScaleWidth,
ScaleLeft ScaleTop, ,
, .

6.4.
Visual Basic 256 ,
.
256

Multimedia .
256
, .
Metafile Visual Basic
256 , 16
QuickBasic.
Visual Basic
long integer.

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 217

217

7/7/2013 5:20:13


:
l RGB.
l QBColor 16
QuickBasic.

QuickBasic ( 4)

QuickBasic RGB Visual
Basic. :

6.4.1. RGB

, BackColor TestForm , QuickBasic


4.

RGB long
integer
.

, , .

0 255
,
.
Form1.BackColor = RGB(0,255,0)
Form2.ForeColor = RGB(0,0,128)



,
. 3

,
.

RGB

&00
&HFF0000
&HFF00
&HFF
&HFFFF00
&HFFFF
&HFF00FF
&HFFFFFF

0
0
0
255
0
255
255
255

0
0
255
0
255
255
0
255

0
255
0
0
255
0
255
255

3: RGB

6.4.2. QBColor
QBColor
0 15,
16

218

TestForm.BackColor = QBColor(4)

0 -

8 -

1 -

9 -

2 -

10 -

3 -

11 -

4 -

12 -

5 -

13 -

6 -

14 -

7 -

15 -

4: 16
QBColor

6.5.
Visual Basic
.
(Image control), (Line control) (Shape control).
.
,
.
,
Circle. Circle ,
Shape .

:
l
,

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 218

7/7/2013 5:20:14


.

.


.

6.6.
Visual Basic



. ,

. ,



.
,
,
.

,
:
l CIs,


.
l PSet,
.
l Point, , RGB,

.
l Line,
.
l Circle, (,
).
l Print,
Debug
. Debug
.
l PaintPicture,
.ico, .wmf, .bmp .dib.
, .

6.7.
,
.

CurrentX, CurrentY

AutoRedraw,
ClipControls

DrawMode,
DrawStyle,
DrawWidth,
BorderStyle,
BorderWidth

FillColor, FillStyle

BackColor, ForeColor,
BorderColor, FillColor

ScaleLeft, ScaleTop,
ScaleHeight,
ScaleWidth,
ScaleMode

5:

6.7.1. 

CurrentX CurrentY

,

.
, .
,
.
:
.CurrentX [ = x]
.Current [ = y]
x y
. twips,
.

6.7.2.
AutoRedraw ( ) boolean
.

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 219

219

7/7/2013 5:20:14

AutoRedraw
,

,
l
l .
AutoRedraw False.


.


.
AutoRedraw True, Visual Basic .

6.7.3.
DrawWidth ( )
Circle, CIs, Line,
PaintPicture, Point, Print PSet.
, , OLE. DrawWidth
1, 1 4 DrawStyle
.
BorderWidth ( )

.
DrawStyle ( ) ,

.
DrawWidth 1, 1-4
DrawStyle .
BorderStyle ( )

.
, BorderStyle
DrawStyle,
. DBList
DBCombo, BorderStyle

220

(border), ,
, ,

. , ,
, , ,
OLE BorderStyle

.
DrawMode ( )


, ,
.
.
.
DrawMode

.

6.7.4.
FillStyle ( )
,
.
FillColor ( )

Line Circle
, . FillColor 0 (),
. FillStyle , FillColor .

6.7.5.
BackColor ( )
ForeColor ( )

.

20 , ,
, ,
..

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 220

7/7/2013 5:20:14

BorderColor ( )
. .

.

:
Form1.BackColor = color
Text1.ForeColor = color
Shape1.BorderColor = color
color

. ,
RGB QBColor, .

6.7.6.
ScaleWidth ( )
ScaleHeight ( )
. ,
.
ScaleWidth ScaleHeight

.
ScaleWidth ScaleHeight Width Height,
,
.
ScaleLeft ( )
ScaleTop ( )
, ,

.
, .
ScaleLeft ScaleTop Left Top
20 .
Left
-

, .
Top
.
Left Top
twips,

.

7. (MULTIMEDIA)
Visual Basic
,
, , video.
OLE DDE , Visual Basic

(authoring tool), Interactive Multimedia
Hypermedia .
Multimedia ,
,
RAM, .
video (.. .avi) (.. .flc), (..
.wav) (.. .bmp)
.

. video ,
,

.

7.1. M
 ultimedia Visual
Basic
(controls) Visual Basic
Multimedia
, , , animation
video. :
l (PictureBox): , Picture,

(..
bmp, dib, wmf, ico ..).
, -

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 221

221

7/7/2013 5:20:14

.
, ,
.

, AutoSize
True.
(Image): .

Stretch
True.
(Label):
BackStyle
Transparent, ,

video,

Multimedia .
(MMControl): interface
Multimedia
(, CD-player, video ..). ,


.
OLE : multimedia
OLE, multimedia .
OLE
multimedia
Visual Basic.

Visual Basic,
OLE
.

Action,
.

OLE
,
Action.

222

Action
:
l 7 OLE.


Verb.

verbs,
.
, AutoVerbMenu
True

OLE.
Verb 2,

(L. Action
= 7),
.
Verb 0,
, ,

(.. edit
, play video).
l 9 ,
(embedded)
OLE, ,

(linked).

7.2.
Visual Basic , multimedia
, .
QuickBasic Sound ()
Play ()
. , Visual
Basic , ,
, Beep ().

Visual Basic
.
-

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 222

7/7/2013 5:20:14

. DLLs
OLE .


.

7.3.
(animation)
Visual Basic
(animation).

, .
: frame-based, object
palette animation.
l (frame-based animation)
,

,
.
l (object
animation) -

, , .

(time-based).
l (palette
animation) ,

. ,
, .
Visual Basic . Visual Basic
,
,
.

7.4. Video
Visual Basic video
,
. video
OLE
ActiveX MCI.

- visual basic

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 223

223

7/7/2013 5:20:14

Delphi
1. TI TO DELPHI . .............. . . . . . . . . . . . . . . . . . 224

10. DIALOGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

2. . . . . . . . . . . . . . . . 224

11. WIN 3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

3. TOY DELPHI . ...... . . . . . . . . . . . . . . . . . 225

12. SAMPLES .. . . . . . . . . . . . . . . . . . . . . . . . . . . 228

4. .. . . . . . . . . . . . . . . . . . 225

13. . . . . . . . . . . . . . . . . . . . . . . . . . 229

5. .. . . . . . . . . . . . . . . . . . 226
6. DELPHI .. . . . . . . . 226

14.

STRINGGRID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

7. STANDARD . ...... . . . . . . . . . . . . . . . . . 227

15. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

8. ADDITIONAL . ... . . . . . . . . . . . . . . . . . 227

16. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

9. SYSTEM . ............ . . . . . . . . . . . . . . . . . 228

17. VIDEO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

1. TO DELPHI

To Delphi
. , 3
client
server Internet.

,
Visual Basic.
(IDE) .
Object
Pascal, .
To Delphi , ,
(.),
. . Delphi

,
.

Internet, .

wizard .

224

2.

(project).

Delphi.


:

Project

Dpr

Units

Pas


( , ,
,
).
.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 224

7/7/2013 5:20:14

Forms

Dfm





,

...

Project
options

Dof



, ...

Resources

Res


Delphi

.

,
, .
Events
. ,
,
.

4.

Backup files ~dp , ~df,

~pa
,
.
Application Exe

executable

To
.
.

object



.


.

Compiled
units

Dcu

3. TOY DELPHI
Windows . .
.

(.dfm) (.pas) .
To Delphi
(Visual
Components)
VCL.

.

.
Delphi ,
, .
Object Inspector
Properties
() Events ().
Properties -

,

.
:

Align

(, , )

Caption

Color

Ctrl3D

Enabled

Font

- delphi

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 225

225

7/7/2013 5:20:14

Height

HelpContext


Hint

,
. :

OnChange

Left

OnClick

Name

OnDblClick

ShowHint

Hint

OnEnter

TabOrder


Tab

OnExit

Tag

OnKeyDown

Top

OnKeyPress

Visible

OnKeyUp

Width

5.

OnMouseDown

OnMouseMove

OnMouseUp

6. 
DELPHI
Delphi
, -
.
,
.

.
,
.

. , . - .

226

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 226

7/7/2013 5:20:15

. , uses

(unit)
(button),
,
Form2.ShowModal Form2.Show,
Form2.

8. ADDITIONAL

BitBtn

7. STANDARD

Main Menu


bitmap



Button.
bitmap

.


bitmap

MaskEdit

StringGrid

DrawGrid

Image


(,
bitmaps
metafile)

Shape


,
...

Bevel

ScrollBox

Label

Edit

Memo

Button

Checkbox

/
/

ListBox

Combobox

ScrollBar

GroupBox

CheckListBox

ListBox
Checkbox

Splitter

StaticText

Label.



Chart

RadioGroup

Panel


, .


Speed Button

PopupMenu

RadioButton

- delphi

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 227

227

7/7/2013 5:20:15

9. SYSTEM

Timer

PaintBox

Media Player

OLEContainer

OLE



OLE

ColorDialog

PrintDialog

PrinterSetupDialog

FindDialog

ReplaceDialog

DDEServerConv, DDE Server


DDEServerltem Server
DDE
server client

Outline

Header

10. DIALOGS
FileListBox


SaveDialog

OpenPictureDialog

-

SavePictureDialog



FontDialog

228

TabSet

OpenDialog

11. WIN 3.1

DDECIientConv, DDE Client


DDECIientltem Client
DDE
server client

DirectoryListBox

DriveCombobox

FilterComboBox



drive

drives

drive

12. SAMPLES

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 228

7/7/2013 5:20:15


Gauge

ColorGrid
SpinButton

SplnEdit

DirectoryOutline

Calendar

13.



.

unit st_un;
interface
uses

Windows, Messages, SysUtils, Classes,
Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
ListBox1: TListBox;
ComboBox1: TComboBox;
RadioGroup1: TRadioGroup;

Panel1: TPanel;
Button2: TButton;
procedure Button2Cli
ck(Sender:
TObject);
procedure Button1Cli
ck(Sender:
TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button2Click(Sender:
TObject);
begin
close;
end;
procedure TForm1.Button1Click(Sender:
TObject);
begin
if C
ombobox1.Text = then
ShowMessage(
)
els
e
case RadioGroup1.ItemIndex of
-1 : ShowMessage(
);
0 : if
ListBox1.Items.IndexOf(Combobox1.
Text)=-1 then
ListBox1.Items.Add(Combobox1. Text);
1 :
ListBox1.Items.Delete(ListBox1.Items

. IndexOf(Combobox1.Text));
end;
Edit1.
Text :=IntToStr
(ListBox1.Items.Count);
end;
end.

,
. (procedures),

(buttons)
.
To Button2
, .
To Button1

- delphi

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 229

229

7/7/2013 5:20:16


RadioGroup1, ListBox1
Combobox1.
,

ShowMessage.
Combobox1
ListBox1. Combobox1.Text.
ListBox1
Add,
ListBox1.

Delete,
ListBox1.
,
. 0, 1 ...
ListBox1,
IndexOf,
.
-1.
RadioGroup1
. RadioGroup1.Itemlndex
. ,
-1. 0
1.
RadioGroup1.Itemlndex .

Edit1
.
ListBox1.Items.Count.
Count Edit1 ,
IntToStr.

14. 

SRINGGRID

StringGrid

.

230

unit add_un;
interface
uses
Windows, Messages, SysUtils,
Classes, Graphics, Controls, Forms,
Dialogs,
StdCtrls, Grids, Buttons;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
StringGrid1: TStringGrid;
StaticText1: TStaticText;
BitBtn2: TBitBtn;
procedure BitBtn2Click(Sender:

TObject);
procedure BitBtn1Click(Sender:

TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure T
 Form1.BitBtn2Click
(Sender: TObject);
begin
close;
end;
procedure T
 Form1.BitBtn1Click
(Sender: TObject);
var
number , line_index , 
col_index
: Integer;
begin
for line_index := 1 to 4 do

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 230

7/7/2013 5:20:16

Stringgrid1.Cells[0, line_index] :=
-+IntToStr(line_index);
for col_index := 1 to 2 do
Stringgrid1.Cells[col_index,0] :=
-+IntToStr(col_index);
number := 0;
for line_index := 1 to 4 do

for col_index := 1 to 2 do
begin
inc(number);
Stringgrid1.Cells[col_index, line_
index] := IntToStr(number);
end;
end;
end.

,
.
(procedures),

(bitbtns) .
To BitBtn2
.
To BitBtn1 StringGrid1 .
StringGrid1 ,
Cells.

StringGrid.

15.
To Delphi Canvas ( ).
pixels (). Pixel
canvas pixel.
pixels.
Canvas.Pixels[x,y],
x y ,

, .. Canvas.Pixels[x,y] := clRed;


pixel .

pixels (Canvas.LineTo(100,200)) (Canvas.e(100,200).


(Pen.Color)
(Pen.Width). Canvas.
Polyline, . Canvas.
Polyline( [ Point(100,100), Point(200,200),
Point(300,300), Point(100,100) ] )
. Canvas.
Brush ()
.
Canvas.Brush.
Color.
Canvas.Rectangle, Pie, Ellipse, Arc
, , ...

16.
bitmap
, Image.

bitmap , Image1.Picture.LoadFromFile(TESTFILE.
BMP)
Image1.Picture.SaveToFile(COPYFILE.BMP).

17. VIDEO

PlaySound, .wav
windows.
MediaPlayer,
video
Play, Pause, Stop, FF, Rew ...



. Open, Play,
Pause, Stop, Eject, Rewind, Next, Previous.
To , MediaPlayer1.Filename
, video. DeviceType dtAutoSelect,

, dtCDAudio, CD .

- delphi

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 231

231

7/7/2013 5:20:16


,
,
(,
video)
MediaPlayer.

Button2: TButton;
procedure 
FilterComboBox1Change
(Sender: TObject);
procedure 
DriveComboBox1Change
(Sender: TObject);
procedure Button1Cl
ick(Sender:
TObject);
procedure Button2Cl
ick(Sender:
TObject);
private
{ Private declarations )
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *. DFM}

unit media_un;
interface
uses
Windows, Messages, SysUtils,
Classes, Graphics, Controls, Forms,
Dialogs, MPlayer, ExtCtrls, StdCtrls,
FileCtrl;
type
TForm1 = class(TForm)
MediaPlayer1: TMediaPlayer;
Panel1: TPanel;
FileListBox1: TFileListBox;
FilterComboBox1: TFilterComboBox;
DriveComboBox1: TDriveComboBox;
DirectoryListBox1:

TDirectoryListBox;
Button1: TButton;

232

procedure TForm1.FilterComboBox1Change
(Sender: TObject);
begin
FileListBox1.
Update;
end;
procedure TForm1.DriveComboBox1Change
(Sender: TObject);
begin
FileListBox1.
Update;
end;
procedure TForm1. Button1Click
(Sender: TObject);
begin
Med
iaPlayer1.
Filename :=
FileListBox1.Filename;
MediaPlayer1.
Open;
end;
procedure TForm1. Button2Click
(Sender: TObject);
begin
close;
end;
end.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 232

7/7/2013 5:20:16

1
1.

1. , ,
2. , , ,

2.



3.
4.
5.
6.
7.

3.



8.
9.
10.
11.
12.

2.



4.
5.
6.
7.
8.

3.


9.
10.
11.
12.

4.

13. , ,
14. , ,

5.

15. ,
16. ,
17. , ,

2
1.

1. 


.
2. 




.
3. 




.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 233

233

7/7/2013 5:20:16

3
1.

1. 



,
.

2.




4.
5.
6.
7. ,
8. ,
9.

2. 

,


.

3.


10.
11.
12.
13.

4.

14. , , , ,
15. , ,

5.

16. ,

3. 

,
.

4
1.

234

1. 




,
,
.
2. 
,




.




.

2.


3. 




,


.
4.
5.
6.
7.  ,

3. 8.
9.
10.
4.

11. , ,
12. , ,
13. , , ,

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 234

7/7/2013 5:20:16

5
1.

2.


4.
5.
6.
7.

3.


8.
9.
10.
11.

4.

12. , ,
13. , , , ,

1. 1.
2.
3. ,

3.


8.
9.
10.
11.

2.


4.

12. ,
13. , , ,
14. ,

4.


9.
10.
11.
12.

5.

13. , , ,
14. , ,

1. 


,

.
2. 

.
3. 




,


.

4.
5.
6.
7.

7
1.

1. , , ,
2. , , ,

2. 3.

4. _

3.


5.
6.
7.
8.

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 235

235

7/7/2013 5:20:16

8
1.

1. , , , ,
2. , , ,

2.



3.
4.
5.
6.
7.

3.




8.
9.
10.
11.
12.
13.

9
1. 1.
2.
3.

3. 8.
9.
10.

2.


4.

4.
5.
6.
7.

11. , ,
12. ,

10
1. 1.
2. ,
3.

3. 8.
9.
10.

2.


4.

11. ,
12. ,

4.



11.
12.
13.
14.
15.

5.



16.
17.
18.
19.
20.

4.
5.
6.
7.

11

236

1.

1. , , , ,

2.




2.
3.
4.
5.
6.
7. , ,

3.

8. , , , ,
9. , ,
10. ,

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 236

7/7/2013 5:20:16

12
1.

1.  ,
, ,

2. 2. - GUI
3.
3.

4.  -, , - ,
-

4. 5.
6.
7.
5.

8.

6.

9. ,
10. , , ,

2.

6. , ,
7. , ,

13
1.



1.
2.
3.
4.
5.

3. 8.
9.
10.

14
1.




1.
2.
3. ,
4. ,
5.
6. 3

7. , , ,
8. , ,
9. ,
10.
11. ,

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 237

237

7/7/2013 5:20:16

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 238

7/7/2013 5:20:16

22-0204 ANAPTIXI EFARMOGON TETRADIO.indb 239

7/7/2013 5:20:16

22-0204 ANAPTIXI EFARMOGON TETRADIO 145-240.indd 240

2/24/14 11:50 AM