Sub SelectCaseExercise()
Dim Answer As Byte
Answer = CByte(InputBox( _
"One of the following is not a Visual Basic keyword" & vbCrLf & _
"1) Function" & vbCrLf & _
"2) Except" & vbCrLf & _
"3) ByRef" & vbCrLf & _
"4) Each" & vbCrLf & vbCrLf & _
"Your Answer? "))
Select Case Answer
Case 1
MsgBox ("Wrong: Function is a Visual Basic keyword." & vbCrLf & _
"It is used to create a procedure of a function type")
Case 2
MsgBox ("Correct: Except is not a keyword in " & vbCrLf & _
"Visual Basic but __except is a C++ " & vbCrLf & _
"keyword used in Exception Handling")
Case 3
MsgBox ("Wrong: ByRef is a Visual Basic keyword used " & vbCrLf & _
"to pass an argument by reference to a procedure")
Case 4
MsgBox ("Wrong: The ""Each"" keyword is used in " & vbCrLf & _
"Visual Basic in a type of looping " & vbCrLf & _
"used to ""scan"" a list of item.")
End Select
End Sub
0 نظر
تازه ترین ها