By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,369 Members | 966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,369 IT Pros & Developers. It's quick & easy.

No operator limits?

P: 2
This problem has been bugging me for days, I just can't get my head round it, I'm a relative newbie to VB, anyway my code says this:

If Asc(varUserInput) >= 48 Or Asc(varUserInput) <= 57 Then
Print varUserInput & ":" & " Is a Number"

ElseIf Asc(varUserInput) >= 58 Or Asc(varUserInput) <= 64 Then
Print varUserInput & ":" & " Is a char"
End If

The intent is clear I hope... however, there doesn't seem to be a limit, because it's saying if anything is > 48 say it's a number, it's says everything is a number, i really need some help on this one, please help guys.
From Grant.
Feb 1 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,247
Hmm, try replacing every "or" by "and".
And please use code tags, just add [code=vb] in front of your codeblock, and the same but without "=vb" and with "/" after "[" at the end. It makes your code more readable.

Feb 1 '08 #2

P: 2
Seems to have worked, thank you very much especially for your quick correspondence, and I'll add the vbcode thingy next time.
Thanks again.
Feb 1 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.