Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How can I validate an input number as integer in VB6?
I created a command button for the following program. But, when I input letters (not numbers), it will return to print "Four digits or above". How can I validate the input must be integer?
Anyone could give a details instruction to me?
Private Sub Command1_Click()
Dim N As Integer
N = InputBox("Enter a positive integer:")
If N < 0 Then MsgBox "Positive Integer Pls!! !": GoTo L10
If N < 10 Then
Print "One digit"
ElseIf N < 100 Then
Print "Two digits"
ElseIf N < 1000 Then
Print "Three digits"
Print "Four digits or above"
Thanks in advance.
0 · ·