473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

No operator limits?

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
2 851
YarrOfDoom
1,247 Expert 1GB
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.


Yarr
Feb 1 '08 #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

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

Similar topics

5
by: bsaucer | last post by:
I am creating a class with operator overloads. It makes references to another class I've created, but do not wish to modify. I try to overload an operator having arguments having the other class...
5
by: Steve | last post by:
Hi, I have a class called cList as so: template<class T> class cList { // base class for Lists private: protected: vector<T> tListOf; // field list container public: void Add(const T& t)...
10
by: Whitney Kew | last post by:
Hello, I have a question regarding type conversion operators. Let's say I have a simple (nonsensical) class as follows: class MakeNewInt { private: int* _n;
14
by: sathya_me | last post by:
Dear clc, I have a variable void *a; Since variable "a" can be assigned (point to) any type and also any type can be assigned to "a" (i.e means "a" = any typed variable; any typed variable =...
6
by: arunaling | last post by:
Hi all, I have the following situation. I want to use the following piece of code to count the number of bits in an integer I use the following piece of code. void bitcount(int k) { for...
8
by: DanielJohnson | last post by:
I am reading K&R and right now in section 2.9 bitwise operators. I understood most of the simple things initially but getting stuck with the later part where different functions like getbits(),...
1
by: Sam Durai | last post by:
Hello, When I use db2exfmt to generate the explain plan, under the Operator section I can see the following arguments listed EARLYOUT FETCHMAX ISCANMAX but I'm not sure what it means. Can...
88
by: santosh | last post by:
Hello all, In K&R2 one exercise asks the reader to compute and print the limits for the basic integer types. This is trivial for unsigned types. But is it possible for signed types without...
13
by: Josip | last post by:
I'm trying to limit a value stored by object (either int or float): class Limited(object): def __init__(self, value, min, max): self.min, self.max = min, max self.n = value def...
44
by: vippstar | last post by:
n1256.pdf (C99 TC3), 5.2.4.1 Translation limits p1 says: Does that mean that *any* program using an array of two or more elements other than char is allowed to be rejected by an implementation?...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.