Skip to main content
GameDev.net gamedev.net
🔒 Locked

Overflow Error in VB

Started by Monder Jan 7, 2003 at 3:21 PM 13 replies 650+ views
Original Post
Monder
Monder
Ok I''m writing some stuff for an access Database in VB for a basic order system thing(it''s a school project). I have this line in my code ItemTotal = RS!Quantity * RS!Price However when RS!Quantity is something like 232 and RS!Price is something like 376 I get an overflow error. ItemTotal has been DIMed as an integer so why do I get this overflow. The numbers involved are not exactly huge
Verb
Verb
IIRC, Integers in VB are the equivelent of a signed short (+/- 32676)

[edited by - Verb on January 7, 2003 5:09:10 PM]
Monder
Monder
Thanks guys. I''m c++ programmer so I''m used to 32-bit ints
capn_midnight
capn_midnight
yeah, VB isn''t exactly standardized. Well, I guess technically it is, since Microsoft is the only one that produces it. It just doesn''t hold up to and REAL standards.

You know, MS touts VB as this great thing that we should all love, and that you can do anything with it, and the syntax is inspired or somethinkg. What assholes.
vtwin
vtwin
quote:
Original post by capn_midnight
You know, MS touts VB as this great thing that we should all love, and that you can do anything with it, and the syntax is inspired or somethinkg. What assholes.


Yeah, and they''re also assuming you do some actual research on the language before you try and use all of its features.

You know, it''s called a learning process. God forbid their language not bend to your every whim. I wonder if you treat all other languages with such distaste?


swift URL | browse my bookmarks [server may not always be on]
SotteD | View/download my Song of the Day
Sensimed | Info/download
Krisc
Krisc
Ya, Visual Basic rules, don''t diss it! I love it and C++ and it is not the language so much as the theories behind it...I say language is 5% of programming

<- Digital Explosions ->
"Discipline is my sword, faith is my shield
do not dive into uncertainty, and you may live to reap the rewards" - (Unreal Championship)
Wildcorn
Wildcorn
We should all still be using binary op codes.
eldee
eldee
quote:
Original post by Krisc I say language is 5% of programming


thank you! heh...
too many people are hung up on syntax.
when you learn VB''s nuances (like the short int problem), it
becomes very easy to just type long instead of integer habitually.
unless i know an int isnt going to go over a a few hundred, i
just automatically declare it a long anyway.

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Waverider
Waverider
Make sure you upgrade to service pack 5 so you can avoid the annoying repeatable illegal operations, too.

One project I was working on ran fine in the environment, but when I tried to build a packagable executable and run it, it would bomb out for no reason at the same place every time.

After I upgraded to SP4, the problem went away.
It's not what you're taught, it's what you learn.
Verb
Verb
quote:
You know, MS touts VB as this great thing that we should all love, and that you can do anything with it, and the syntax is inspired or somethinkg. What assholes.


VB is a very useful tool, much more useful than some of the more powerful languages like c/c++ in some situations.
Krisc
Krisc
Ya, agreed, for example, I am working on a configuration file editor for my game (written in VB of course) that will decrypt/encrypt my config files! Small project and it doesn''t need a powerfull language...

<- Digital Explosions ->
"Discipline is my sword, faith is my shield
do not dive into uncertainty, and you may live to reap the rewards" - (Unreal Championship)
luxitan
luxitan
i agree with you, i''ve made a school project for artificial inteligence, i mada pacman style game all in c++ but the level editor was made in vb, saves a lot of work (and specialy time) with c that simple level editor would take ages to do

luxitan
To be considered a genius you just have to say what everybody knows in a way very few understand

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.