. , , True, , - False. .
.
: >, <, =, >=,<=, <>.
, , Not, And, Or.
A B 7.3.
7.3
A | B | Not A | A And B | A Or B |
True | True | False | True | True |
False | True | True | False | True |
True | False | False | False | True |
False | False | True | False | False |
VISAUL BASIC :
IF,
CASE.
IF.
IFTHEN. : () ().
) :
If Then 1 [ Else 2]
) :
If Then
1
[ Else
2]
EndIf
IF . 7.7.
. 7.7. IF:
) IF :
If 1 Then
1
ElseIf 2 Then
2
ElseIf n Then
n
[Else
Else]
End If
:
Public Function Obr_Err (Err_Num As Integer) As _
Integer
Dim Txt As String
If Err_Num=6 Then
Txt=: Obr_Err=2
ElseIf Err_Num=11 Then
Txt= : Obr_Err=2
Else
Txt= &Err_Num: Obr_Err=3
EndIf
Err.Clear
MsgBox Txt, VbOkOnly,
End Function
SELECT CASE
.
:
Select Case
Case 1
1
Case 2
2
Case 3
3
.
Case Else
Else
End Select
Select Case. (, , ).
, (;).
, . :
|
|
-
- 1 To 2
- Is ( )
, Is >= 10
, , . 7.8.
. 7.8.
Select Case.
Print Cls
Print . Printer.Print, Print.
Cls , . , Print .
VISAUL BASIC :
1) For Next
2) While Wend
3) Do Loop
For Next
ForNext :
For = To [Step ]
Next [ ]
6, . 7 .
Private Sub Command1_Click()
Dim a(7) As Integer, s As Integer
s = 0
For i = 1 To 7
a(i) = Val(InputBox(" "))
s = s + a(i)
Next
Print s
End Sub
WHILEWEND
:
While
Wend
4 - , 1, . - . 6.7.
Private Sub Command1_Click()
Dim x As Single
x = InputBox(" ")
While x > 1
Print x
x = x / 2
Wend
End Sub
DOLOOP
( ).
:
) Do While
Loop
) Do Until
Loop
:
) Do
Loop While
) Do
Loop Until
. 7.9 .
. 7.9. .