Results 1 to 6 of 6

Thread: Newbie here, I have two quick questions VB2010

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    9

    Newbie here, I have two quick questions VB2010

    Hi to all, my first question is

    1.) What is the difference between Dim, Double, Decimal and Integer? When declaring the variables in your code? if you can name a few more with their definitions that would be great!

    and my second question is

    2.) I have created a simple code using picture box and radio buttons. The each radio button has an item for example: radio button 1 says "car" , radio button 2 says " house" and radio button 3 says "computer". How can i make it to where i when i click on radio button 1 a picture of a car should show and when i click on 2 a house should show, etc. how do i make that magic happen???? please help. do i just use one picture box or three?

  2. #2
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: Newbie here, I have two quick questions VB2010

    I would recommend that you go through this site,
    http://www.homeandlearn.co.uk/net/vbNet.html

    to answer your question

    Dim declares the variable

    Double , decimal ,integer are type of variables


    Dim x as integer


    have a look herehttp://msdn.microsoft.com/en-us/libr...(v=vs.71).aspx

    Welcome to programming its a lot of fun and this forum is hands the best

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Newbie here, I have two quick questions VB2010

    Those sounds like homework questions. The first sounds like a quiz question. We don't mind answering questions, but I, for one, am not so keen on doing somebody elses homework.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    9

    Re: Newbie here, I have two quick questions VB2010

    Thanks for you help. i went to the page you recommended and just wanted to know what exactly does it mean when it says 'unsigned'
    for example for byte it says 0 to 255 (unsigned)?

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,414

    Re: Newbie here, I have two quick questions VB2010

    unsigned means the value can't be less than 0

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Newbie here, I have two quick questions VB2010

    The point behind unsigned is this:

    Every numeric type takes up a certain amount of memory. A byte takes one byte (of course), an Integer takes four bytes, a Long takes 8 bytes. If we take just the byte, as an example, you have 8 bits, so there are only 256 possible numbers, but there are two possible ranges of numbers you could use. The first range is 0-255, which is most typical for a byte, but the other possible range is -127 to 127. Generally, we want to be able to use negative numbers, but it decreases the largest number that the byte can represent. The reason is that you need a way to include the negative sign in the number, so if you were to just use one of the eight bits in the byte to hold the negative sign, then you only have 7 bits left to hold the values, and the maximum number you can put in 7 bits is 127. In fact, negative numbers are not really represented quite like that, but it works out about the same way: 7 bits for the value and one bit for the sign. So, you can use negatives, but you lose the upper end of the range. Bytes are almost always unsigned, as negative numbers generally aren't stored in bytes. Integers are always signed so that you can use a large range of positive and negative numbers (31 bits worth, in fact), but there is also the unsigned integer, or UInt, supplied if you want twice the range of positive values and are willing to pay the cost of never being able to use negative numbers. Similar things exist for the Long, as well.
    My usual boring signature: Nothing

Posting Permissions

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



Click Here to Expand Forum to Full Width