VBA/Excel/Access/Word/Language Basics/Debug.Assert — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:33, 26 мая 2010
Assert
Sub addNumbers2()
Dim intNumber1 As Integer
Dim intNumber2 As Integer
Dim intSum As Integer
intNumber1 = 5
intNumber2 = 3
Debug.Assert intNumber1 = 5
Debug.Assert intNumber2 = 7
intSum = intNumber1 + intNumber2
Debug.Print "The sum of the two numbers is: " & intSum
End Sub
Using Assertions
Sub Assertion()
Dim intAge As Integer
intAge = InputBox("Please Enter Your Age")
Debug.Assert (intAge >= 0)
msgBox "You are " & intAge
End Sub