|
-
Oct 11th, 2001, 12:15 AM
#1
Thread Starter
New Member
-
Oct 11th, 2001, 01:27 AM
#2
Addicted Member
How about this?
Do
sResult = InputBox$("Please input a frequency....)
For i = 1 To 6
If CInt( sResult) = sFreq( i ) Then
'Do something here...if equal
Exit For
End If
Next i
If i > 6 Then
Call Msgbox("Invalid Input...)
Else
Exit Do
End If
Loop Until True
 Stupidity is better than cure.
VB6 SP5 Enterprise Ed.
C, Pascal, VC++ 6.0
Running Win98 SE and Win2000 Prof. Ed.
Email me at : [email protected]
-
Oct 11th, 2001, 03:15 AM
#3
Thread Starter
New Member
thanks rbnwares.
i hv get it done.
-
Oct 11th, 2001, 03:22 AM
#4
Code:
Dim strInpBox As String
strInpBox = InputBox("Enter A Number ...")
If (StrPtr(strInpBox) = 0) Then
MsgBox "You hit the cancel button"
ElseIf Not (IsNumeric(strInpBox)) Then
MsgBox "You didn't enter a numeric value"
ElseIf (CInt(strInpBox) > 6) Then
MsgBox "The number's above 6"
ElseIf (InStr(strInpBox, ".")) Then
MsgBox "The number has a decimal place in"
Else
MsgBox "Number's fine !"
End If
That should more or less cover everthing the user could do to bugger the number up If you need any of that explained, let me know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|