Visual Basic Variables - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Visual Basic Variables

Description:

A variable that follows Dim has been assigned. Dimension. Dim stands for ... Don't be fooled! Declare Variables. Where do you declare variables? In the middle ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 15
Provided by: lanceco2
Category:

less

Transcript and Presenter's Notes

Title: Visual Basic Variables


1
Visual Basic Variables
  • Molloy College
  • Dr. Cohen

2
Dimension
  • Dim stands for dimension. A variable that
    follows Dim has been assigned

3
Dimension
  • Dim stands for dimension. A variable that
    follows Dim has been assigned space in memory.

4
Example
  • Dim dblRadius As Double
  • A Double usually contains a

5
Example
  • Dim dblRadius As Double
  • A Double usually contains a decimal.

6
Assignment
  • Through assignment a variable is given

7
Assignment
  • Through assignment a variable is given
  • value.

8
Assignment
  • Which statement assigns a value?
  • A. 12.3 dblRadius
  • B. dblRadius 12.3

9
Assignment
  • Which statement assigns a value?
  • B. dblRadius 12.3
  • Dont be fooled!

10
Declare Variables
  • Where do you declare variables?
  • In the middle
  • At the beginning
  • At the end
  • Avoid declaring variables

11
Declare Variables
  • Where do you declare variables?
  • At the beginning

12
Example
  • Private Sub cmdCalc_Click ( )
  • Dim intSum
  • Dim dblPrice
  • Dim intQuantity
  • intSum dblPrice intQuantity
  • End Sub

13
Doubles
  • Must a Double be a decimal?
  • Yes or No

14
Doubles
  • Must a Double be a decimal?
  • No
Write a Comment
User Comments (0)
About PowerShow.com