Can anyone show a newbie how this works? I tried doing it myself but I seem to keep getting errors and the book I'm using is not so helpful.

For example, I want to calcuate the gallon of paint (Length + Width) times 2 times 10 feet height and divide it all by 300.

My understanding is you have to start it off by "Dim" correct? Can anyone show me how this works?



  • Hi Young, yes this Dim you speak of is the way in which you declare variables. You do Dim As . You can then assign values to these variables and perform calculations on them. For instance your code would need to be something like (but more added):

    Dim intWidth as Integer
    Dim intHeight as Integer
    Dim intResult as Integer

    IntWidth = 50
    IntHeight = 100
    IntResult = (IntWidth * IntResult) / 2



    This would display a message simply saying 2500.
    For more on variables take a look at:
    And any other beginner sites for VB.NET

    HTH, Dai

    Do or do not, there is no try. |
  • I tried the int and it kept giving me error, what am I doing wrong?

  • Try changing it to double.


    Do or do not, there is no try. |
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!