'
'Logical Structures
Dim
flag
As
Integer
'
1)
If
True
Then
flag
=
1
Else
flag
=
0
Debug.Assert flag
=
1
'
2)
If
False
Then
flag
=
1
Else
flag
=
0
End
If
Debug.Assert flag
=
0
'
3)
flag
=
IIf
(
True
,
1
,
0
)
Debug.Assert flag
=
1
'
'Logical Operators
Debug.Assert (
1
=
1
)
=
True
Debug.Assert
Not
(
1
=
1
)
=
False
Debug.Assert (
True
And
False
)
=
False
Debug.Assert (
True
Or
False
)
=
True
'
'Loop Structure
For
i
=
1
To
5
If
Then
Exit
For
'
相当于Break
End
If
Next
i
posted on 2008-03-25 18:05
Jcat 阅读(208)
评论(0) 编辑 收藏 所属分类:
VBA