.


:




:

































 

 

 

 





4.4

 

 

 

4.4.5.

 

,

 

 

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

. , , , , . , . , , VB , , , . , , Click. VB .

VB , , , .

VB , . , , . , , VS . , , VB , . , 60 , Click, DoubleClick, DragDrop, DragOver, GotFocus. , , .

, , , , , . VB .

, . , , , . L ( ). True (), , , False (), .

VB Boolean. , L:

Dim L As Boolean

 

L : True False. 0 False, 1. ,

 

Dim f As Double = 6.8 L = CBool(f) ' L = True f=0 L = CBool(f) ' L = False

 

.

, ().

() . 4.4.2-1.

 

4.4.2-1

=
< ,
> ,
<=
>=
<>

 

4.4.2-2 .

4.4.2-2

5 < 10 True, 5 10
5 > 10 False, 5 10
7 <> 3 True, 7 3
X > 45 True, X 45; False
TextBox1.Text="Stop" True, "Stop"; False
5 - 1 > 1 + 2 True, 5-1 (4), 1+2 (3) , 4 > 3, .. 4 3
X >= y + z True, X y z; False

 

, , .., .

, , , . 4.4.2-3 .

, Not 7 < 9 False,
4 > 3 And 7 < 9 True.

.4.4.2-4 ( ). T (True) , F (False) .

 

(. .3-5.3-8) .

VB : If, If Select Case.

 

4.4.2-3

Not True False False True
And ,
Or ,
Xor ,

4.4.2-4

Not x   X And y   X Or y   x Xor y  
X Y
T T F T T F
T F F F T T
F T T F T T
F F T F F F

 

If :

 

If L Then () [Else () ]

 

: L True, ( , ), Then, , Else. If Else ( ), .

If , .

If:

 

If x > 0 Then y = Sqrt(x) Else y = 1 If d=>10 Then epsilon = 0.001 If lambda < 1 Or beta = 3 Then lambda = beta: x = 0 If x < 10 Then y = 1 Else If x < 100 Then y = 2 Else y = 4

 

, , ( ) If. :

If L1 Then [ __1 ] [ElseIf L2 Then [ __2 ]... Else [ __n ] ] End If

If :

L1 True, __1 , End If.

L1 False, .

If , End If.

If ElseIf.

, Else, , False.

ElseIf Else , .

If Then , Else .

ElseIf , End If .

If:

If x>0 Then y =Sqrt(x) z=1+y p=4 End If If x < 10 Then y=1 Else y=2 z=4 End If

 

, . , .. .

 

4.4.2-1. /, .

vvodDbl1()
ViodDbl1() Double , vvodSng3() vivodSng3() Single vvodInt4() vivodInt4() Integer .

vvodDbl1(), vivodDbl1(), vvodSng3() vivodSng3() 4.4.3, vvodInt4() vivodInt4() . 4.4.2-1 4.4.2-2.

 

'-Function Integer ' TextBox Function vvodInt4(ByVal T As TextBox) As Integer Return CInt(T.Text) End Function

 

. 4.4.2-1. Integer TextBox

 

'-Sub Integer TextBox Sub vivodInt4(ByVal Z As Integer, ByVal T As TextBox) T.Text = CStr(Z) End Sub

 

. 4.4.2-2. Integer TextBox





:


: 2016-11-18; !; : 466 |


:

:

, ,
==> ...

1303 - | 1261 -


© 2015-2024 lektsii.org - -

: 0.022 .