For more information, please see full course syllabus of Visual Basic
For more information, please see full course syllabus of Visual Basic
Discussion
Study Guides
Table of Contents
Declaring Variables
- Dim stands for Dimension, you are telling VB how big of space to set aside for your variable (the dimensions of the variable space)
- Value types hold their data directly
- Reference types only hold a pointer to the actual data somewhere else in memory
- All built-in numeric types are value types
- Use a data type with enough precision for the work you need to do
- {Enter Data Type Information}
- {Enter Variable Naming Information}
- Numeric variables default to 0 (zero)
- String variable default to an empty string
- Objects are initialized to Nothing (null)
- Constants never change during the program execution
- Constants can be any data type
- Usually all uppercase so they are easily seen when scanning code
- Implicit conversions are always allowed for widening conversions (where the source data type is less precise than the destination data type)
- Explicit conversions are for narrowing conversions
- Null means "never entered"
- Use ? after the variable name in the Dimension statement
- Boolean is a "Yes or No"/"True or False" type variable
- False always converts to/from zero
- Although discouraged, you can use a reserved word for a variable name by always surrounding it with brackets [ ]
Computer Science: Visual Basic

John Snape
Declaring Variables
Slide Duration:Table of Contents
46m 9s
50m 5s
14m 11s
35m 5s
36m 35s
19m 4s
49m 40s
23m 15s
23m 57s
17m 26s
6m 46s
34m 16s
16m 30s
9m 6s
23m 10s
14m 37s
7m
22m 19s
18m 49s
8m 17s
13m 4s
31m 57s
56m 56s
33m 17s
18m 22s
12m 45s
34m 55s
13m 39s
26m 9s
37m 23s
40m 42s
22m 24s
22m 15s
38m 58s
43m 36s
17m
30m 36s
38m 6s
1h 9m 59s
35m 23s
42m 23s
25m 58s
24m 41s
32m 45s
18m 29s
13m 28s
9m 31s
22m 30s
23m 2s
14m 9s
11m 4s
14m 44s
34m 7s
8m 11s
31m 24s
16m 56s
11m 48s
44m 54s
15m 7s
17m 29s
15m 29s
17m 50s
1 answer
Wed Dec 17, 2014 6:47 PM
Post by joseph pulliam on November 15, 2014
I have a question. When writing in Visual Studio Express 2012? There is no console. I am trying to figure out how to write a program for determining price per pounds with weight in ounces and pounds.
1 answer
Mon Jul 28, 2014 2:19 PM
Post by Jean Uwumuremyi on July 26, 2014
Anybody else having problems opening the exercise files?