Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
formlesstree4

Lesson I - Learning about Variables

Recommended Posts

Lesson I: Variables

 

Visual Basic .NET has several types of Variables built into the Framework. The most common ones you will see are:

 

String, Double, Integer, and Decimal.

 

String is for storing text, like a sentence or a word.

Double is for storing numbers involved in equations.

Integer is for storing 32 bit numbers.

Decimal is for storing numbers with a decimal value.

 

Extra Information:

 

Double variables take up more memory than Integer or Decimal, but provide easier access in equations, and can be utilized in such ways like using them in multiplication. Doubles can in fact hold decimals, but they are not as accurate as Decimal Variables, because they are floating point.

MSDN's Definition: Doubles represent a double-precision floating-point number.

 

Integers are when you need to store a number, and call it back later, but not modify it. They don't take up as much memory as Double variables do.

MSDN's Definition: Integers are numbers without decimals

 

Decimals are for when accuracy is important in an answer. Decimals cannot be used in equations, but can hold the answers to an equation, and are techincally faster in rounding because they are not floating point.

MSDN's Definition: Decimals represent a decimal number.

 

Now that you have a (somewhat) general idea on these variables, the next lesson will be to actually use them.

Share this post


Link to post
Share on other sites

Thanks a lot for writing this! I can't wait to learn more!

 

What is a 32-bit number, and what is floating point?

 

 

Thanks!

Share this post


Link to post
Share on other sites

Sorry for the late reply.

32 Bit Integers will store up to 10 Decimal Digits (not places, the numbers to the left of the decimal point), while a floating point will grow exponentially until it fills it's allotted memory bound. That's what I believe the differences are.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...