+ Reply to Thread
Results 1 to 3 of 3

Thread: VB.NET from beginner to advanced programmer Part 4 - The basic data types

  1. #1
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    VB.NET from beginner to advanced programmer Part 4 - The basic data types

    Welcome to the VB.NET tutorial series: "VB.NET from beginner to advanced programmer" which will take you from the very beginning to be a good programmer. VB.NET is a good first language for new programmers so this 21 part long series is written for completely beginners but it will also works perfectly fine if you already know another programming language.


    VB.NET from beginner to advanced programmer
    1. Introduction and Installation
    2. Objects and Events
    3. Variables
    4. The basic data types
    5. Logical Operators
    6. Relational Operators
    7. If statements Then
    8. Arithmetical Operators
    9. Loops Part 1
    10. Arrays
    11. Loops Part 2
    12. Try Catch statements
    13. Subs and Functions
    14. Difference between Scopes
    15. Select Statements
    16. Multidimensional arrays
    17. Structures
    18. Classes
    19. Enumerations
    20. Advanced Comments
    21. Compiling Directives




    From the last part you learned that variables and constants use different types depending on what values that should stored in them. This Part will teach you the basic types so you know what to use.





    Boolean

    A boolean value is either True or False. Boolean values are important when using logical operators and relational operators(See part 5 and 6 for more info).


    Integer

    The Integer types can (of course) store Integer values. There is three sizes of Integers which all can be both Signed and Unsigned and can be written in to ways for a total of 12 "different" types.

    Short or Int16
    The smallest of them, can store values with a 65,535 long span.

    Integer or Int32
    The medium size , can store values with a 4,294,967,295 long span.

    Long or Int64
    The Largest of them all , can store values with a 18,446,744,073,709,551,615 long span.




    By adding a "U" to them they become unsigned(UInt32,ULong etc.), When they are Unsigned the span starts from 0 and goes up, and when they are signed they have the half span below 0 and the other half above.

    For example, Short(or Int16) has the span length 65,535.
    If it's signed(Short or Int16) it has the span from -32,768 to 32,767.
    And if it's unsigned(UShort or UInt16) the span goes from 0 to 65,535.





    Single


    The single type is a numeric type which can store decimals too. It can store values from 1.401298*10-45 to 3.4028235*1038 for both positive and negative values with a total of 7 decimal places.



    Double


    The type double, is also a numeric type with decimal places. The double can store bigger(and smaller) values then the Single. The span goes from -4.94065645841246544*10-324 through 1.79769313486231570*10308 for both positive and negative values. The Double can store a total of 15 decimals.



    String

    The string type can store text. To write a string you start with one double quote and end with another, like this:

    Code:
    Dim sMessage ="This is a string"
    In a string variable you can store up to aproximatelly 2 billion(!) Unicode characters.


    Char

    Only stores one character, as with Strings you surrounds it by double quotes.


    Now you should be able to use the basic types, see you in next part, Part 5.
    Last edited by Vswe; 03-21-2010 at 03:25 PM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: VB.NET from beginner to advanced programmer Part 4 - The basic data types

    Nicely done. +rep
    Where is byte and long?

  4. #3
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: VB.NET from beginner to advanced programmer Part 4 - The basic data types

    Long is there and I must have forgot to write about byte.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VB.NET from beginner to advanced programmer Part 18 - Classes
    By Vswe in forum Visual Basic Tutorials
    Replies: 3
    Last Post: 11-02-2009, 06:30 AM
  2. Replies: 1
    Last Post: 11-02-2009, 06:05 AM
  3. Replies: 1
    Last Post: 11-02-2009, 05:46 AM
  4. VB.NET from beginner to advanced programmer Part 10 - Arrays
    By Vswe in forum Visual Basic Tutorials
    Replies: 2
    Last Post: 11-02-2009, 05:45 AM
  5. Replies: 1
    Last Post: 11-02-2009, 05:43 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts