vb Number Length
NUMBER LENGTH
VB CODE IS -
Private Sub cmdCalculate_Click()
Dim n As Long
n = Val(txtNum.Text)
Select Case n
Case 0 To 9
lblResult.Caption = "Single digit number"
Case 10 To 99
lblResult.Caption = "two digit number"
Case 100 To 999
lblResult.Caption = "Three digit number"
Case 1000 To 9999
lblResult.Caption = "Four digit number"
Case 10000 To 99999
lblResult.Caption = "Five digit number"
Case Else
lblResult.Caption = "More than Five digit number"
End Select
End Sub
Comments
Post a Comment