• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

Looping a byte from 0 To 255 gives Owerflow error

Hi!

    Dim x As Byte
    For x = 0 To 255
        Debug.Print x
    Next x

Why does this raise an error?
0
dbrckovi
Asked:
dbrckovi
1 Solution
 
Sys_ProgCommented:
I am not aware much of VB
But BYTE would be able to store 1 byte of data
i.e.
the range of values would be

-128 to 127

Thus, u have exceeded the limit

Amit
0
 
zzzzzoocCommented:
Answered it in your other question when you mentioned it.. :)

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20947594.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now