-
August 18th, 2014, 11:37 AM
#1
Integers. Should I dim my variables as integers?
I was just wandering. When I have vb6 do mathematical calculations, should I dim my variables as integers or do I not dim them. It works both ways but I was just wandering.
-
August 18th, 2014, 12:50 PM
#2
Re: Integers. Should I dim my variables as integers?
only for WHOLE numbers between -32K and 32K
-
August 18th, 2014, 03:19 PM
#3
Re: Integers. Should I dim my variables as integers?
-
August 18th, 2014, 11:51 PM
#4
Re: Integers. Should I dim my variables as integers?
Actually Long is a bit faster I think and can hold larger values than an Integer can up to 2 billion as opposed to 32k for an Int. Long does use more memory but is processed faster on 32 bit systems and I assume also on 64 bit systems
If you need to work with numbers that may have decimal places then those would need to be either Currency, Single or Double. Using Integer or Long will cause rounding.
You should look in the online help at the various data types to determine which is best for your needs.
Always use [code][/code] tags when posting code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|