Qbasicnews.com

Full Version: a% = 200: b% = a%: c& = a% * b% ERROR! HELP!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
..
..
or a negative number when running an executable, right? Well, you tried to square 200 and store the result (40,000) as an INTEGER. INTEGER variables must be between -32,768 and 32,767. In the process of performing the multiplication, even though you tried to assign the result to a LONG variable, the result was stored temporarily in an INTEGER data space.
Code:
a% = 200: b% = a%: c& = a% * CLNG(b%)

(As I go to post this I see Glenn has responded...)
clng? Ah, thanks.
Now 2000! takes less than 46.8 seconds to compute!! :]
:normal: Ok. I'm very competitive now ,,..,,..