SlideShare a Scribd company logo
CHAPTER 2:
DATA TYPES,
VARIABLES And
Constants
Variables and Data Types
• A variable is a letter or name that can store a value. More
technically we can define a variable as a pointer to a block of
memory that stores information.
• When you create computer programs, you can use variables to
store numbers, such as the height of a building, or words, such
as a person's name. Simply put, you can use variables to
represent any kind of information your program needs.
• You might ask, "Why use a variable when I could just use the
information instead?" As the name implies, variables can
change the value that they represent as the program is running.
• The information that is stored in a variable is of a certain data
type.
• That data may be an integer like "23", a floating point number
like "23.23", a string like "Hello World!", and many other data
type.
Variables and Data Types
Using a Variable
To use a variable, you must give it a name. There are rules you
should, and usually must, follow when naming your variables.
The name of a variable:
• Must begin with a letter
• Cannot have a period (remember that we use the period to
set a property; in other words the period is an operator)
• Can have up to 255 characters. Please, just because it is
allowed, don't use 255 characters.
• Must be unique inside of the procedure or the module it is
used in.
Good habits with variables
For the sake of making sure other people can look at your code and
know what you were thinking:
• Prefix your variable name with the appropriate prefix for your
variable's data type.
• Make sure the body of your variable name makes it easy to tell
what its used for.
• Don't use an ambiguous name like "intBlabla" or "strX" unless its
use is within a very small scope of the program, and even then try
not to do it much. Try using descriptive names. For example,
IntTotSalary to design the total of a salary.
Visual Basic Data Types
Visual Basic type Common language
runtime type structure
Value range
Boolean Boolean True or False
Byte Byte 0 through 255 (unsigned)
Char (Single
character)
Char 0 through65535 (unsigned)
Date Date and Time 0:00:00 (midnight) on January 1, 0001
through 11:59:59 PM on December 31, 9999
Decimal Decimal -
Double Double -
Integer Int32 -2,147,483,648 through 2,147,483,647
Long (long
integer)
Int64 -9,223,372,036,854,775,808 through
9,223,372,036,854,775,807
Visual Basic type Common language
runtime type structure
Value range
Object Object (class) Any type can be stored in a variable of type
Object
SByte SByte -128 through 127
Short (short
integer)
Int16 -32,768 through 32,767
Single single -
String (Variable
length)
String (class) 0 to approximately 2 billion Unicode
characters
UInteger UInt32 0 through 4,294,967,295
ULong UInt64 0 through 18,446,744,073,709,551,615
UShort UInt16 0 through 65,535
Visual Basic Data Types
There are two principle ways to add variables to your applications.
• implicit declaration : is to let Visual Basic automatically create the variable for you.
For an implicit declaration, Visual Basic automatically creates a variant for each
identifier it recognizes as a variable in an application.
• At first glance, this codes look the same. But because the tempVal variable is
misspelled as the argument to Sqrt, the compiler creates an additional local variable
called temVal, which is never assigned a value, and your function always returns
zero.
Declaring Variables (Implicit Declaration)
Function safeSqrt(num)
' Make sure num is positive for square root.
tempVal = Math.Abs(num)
Return Math.Sqrt(tempVal)
End Function
Function safeSqrt(num)
' Make sure num is positive for square root.
tempVal = Math.Abs(num)
Return Math.Sqrt(temVal)
End Function
• The second approach to declaring variable is to explicitly declare them with
one of the following keywords: Dim, Static, Private, and Public. The choice
of keyword has a profound effect on the variable’s scope within the
application and determines where the variable can be used in the program.
By default, the Visual Basic compiler enforces explicit declaration (what I also
strongly advice), which requires that you declare every variable before you
use it. You can remove this requirement and permit implicit declaration.
Declaring Variables (Explicit declaration)
Function safeSqrt(num)
Static tempVal as Integer
' Make sure num is positive for square root.
tempVal = Math.Abs(num)
Return Math.Sqrt(temVal)
End Function
ERROR MESSAGE
Declaring Variables (Explicit declaration)
• Now that you have an understanding of the allowable types in VB .NET, you
need to learn how to use these types in your code.
• To declare a variable, you use a variable declaration statement. The
following is the basic syntax for variable declaration in VB .NET:
• The following would be an example of the variations of the declaration
statement:
Dim intX as Integer
Privat e intX as Integer
Public intX as Integer
Static intX as Integer
Protected intX as Integer
Friend intX as Integer
[ Dim | Public | Protected | Friend | Protected Friend | Private |
Static ] variablename As [ New type] = [expression]
Variable defaults
When you declare a variable of a type without assigning a value to it,
the variable has a default value based on the type of variable you have
assigned as the type. The following are the default values for different
types:
 Numbers: 0 (zero)
 Boolean: False
 String: Nothing
 Object: Nothing
 Date: 12:00:00 AM
Constants
• A constant allows you to use a friendly name for a variable value that does
not change throughout the execution of your application.
• Constants in Visual Basic .NET act exactly as they did in previous versions.
• To declare a constant, you use the Const keyword within a procedure or at
the declarations section of your classes or modules.
• Constants can be declared with the scope of Private, Public, Friend,
Protected, or Protected Friend.
• The following is the usage of the Const statement:
[Public | Private | Friend | Protected | Protected Friend ] Const
constantname As [ New type ] = [expression]
• When you declare a constant, you must declare it as a certain type.
• Constants can be declared as Boolean, Byte, Char, DateTime, Decimal,
Double, Integer, Long, Short, Single, or String data types.
• In the following code, you are declaring several constants and then using
them in the procedure within the module.
Constants
Module Module1
Private Const BillsSalary As Double = 10,000
Private Const MySalary As Byte = 1,000
Private Const strMsg As String = "Try Again Please"
Private Function Test_Salary() As Boolean
If MySalary > BillsSalary Then
Console.WriteLine(strMsg)
End If
End Function
End Module
Ad

Recommended

Visual Basic Fundamentals
Visual Basic Fundamentals
DivyaR219113
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
Abha Damani
 
Variables and calculations_chpt_4
Variables and calculations_chpt_4
cmontanez
 
Introduction to Visual Basic
Introduction to Visual Basic
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
Variable and constants in Vb.NET
Variable and constants in Vb.NET
Jaya Kumari
 
Variable, Functions, Scoping and Variable Conversion
Variable, Functions, Scoping and Variable Conversion
abacusgtuc
 
CHAPTER 3- Lesson A
CHAPTER 3- Lesson A
MLG College of Learning, Inc
 
VB PPT by ADI PART2.pdf
VB PPT by ADI PART2.pdf
AdiseshaK
 
VB PPT by ADI PART2.pdf
VB PPT by ADI PART2.pdf
Prof. Dr. K. Adisesha
 
vb.net.pdf
vb.net.pdf
VimalSangar1
 
Visual Basic Review - ICA
Visual Basic Review - ICA
emtrajano
 
UNIT-II VISUAL BASIC.NET | BCA
UNIT-II VISUAL BASIC.NET | BCA
Raj vardhan
 
Ppt lesson 05
Ppt lesson 05
Linda Bodrie
 
Lesson 5 PP
Lesson 5 PP
Linda Bodrie
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.net
Jaya Kumari
 
Variables in Visual Basic Programming
Variables in Visual Basic Programming
Kasun Ranga Wijeweera
 
Ch (2)(presentation) its about visual programming
Ch (2)(presentation) its about visual programming
nimrastorage123
 
Visual basic
Visual basic
pavishkumarsingh
 
Learning VB.NET Programming Concepts
Learning VB.NET Programming Concepts
guest25d6e3
 
Variable scope ppt in vb6
Variable scope ppt in vb6
AmanHooda4
 
Visual Programming
Visual Programming
Bagzzz
 
Visual Basics for Application
Visual Basics for Application
Raghu nath
 
Visual basic intoduction
Visual basic intoduction
mohamedsaad24
 
Chapter 03
Chapter 03
Rooney Joh
 
different data types used in programming VB .pptx
different data types used in programming VB .pptx
meemee7378
 
.NET Variables and Data Types
.NET Variables and Data Types
LearnNowOnline
 
E learning excel vba programming lesson 3
E learning excel vba programming lesson 3
Vijay Perepa
 
object oriented fundamentals in vb.net
object oriented fundamentals in vb.net
bantamlak dejene
 
Introduction to Visual Basic Programming
Introduction to Visual Basic Programming
abacusgtuc
 
network-security_for cybersecurity_experts
network-security_for cybersecurity_experts
abacusgtuc
 

More Related Content

Similar to CHAPTER 2 (Data types,Variables) in Visual Basic Programming (20)

VB PPT by ADI PART2.pdf
VB PPT by ADI PART2.pdf
Prof. Dr. K. Adisesha
 
vb.net.pdf
vb.net.pdf
VimalSangar1
 
Visual Basic Review - ICA
Visual Basic Review - ICA
emtrajano
 
UNIT-II VISUAL BASIC.NET | BCA
UNIT-II VISUAL BASIC.NET | BCA
Raj vardhan
 
Ppt lesson 05
Ppt lesson 05
Linda Bodrie
 
Lesson 5 PP
Lesson 5 PP
Linda Bodrie
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.net
Jaya Kumari
 
Variables in Visual Basic Programming
Variables in Visual Basic Programming
Kasun Ranga Wijeweera
 
Ch (2)(presentation) its about visual programming
Ch (2)(presentation) its about visual programming
nimrastorage123
 
Visual basic
Visual basic
pavishkumarsingh
 
Learning VB.NET Programming Concepts
Learning VB.NET Programming Concepts
guest25d6e3
 
Variable scope ppt in vb6
Variable scope ppt in vb6
AmanHooda4
 
Visual Programming
Visual Programming
Bagzzz
 
Visual Basics for Application
Visual Basics for Application
Raghu nath
 
Visual basic intoduction
Visual basic intoduction
mohamedsaad24
 
Chapter 03
Chapter 03
Rooney Joh
 
different data types used in programming VB .pptx
different data types used in programming VB .pptx
meemee7378
 
.NET Variables and Data Types
.NET Variables and Data Types
LearnNowOnline
 
E learning excel vba programming lesson 3
E learning excel vba programming lesson 3
Vijay Perepa
 
object oriented fundamentals in vb.net
object oriented fundamentals in vb.net
bantamlak dejene
 
Visual Basic Review - ICA
Visual Basic Review - ICA
emtrajano
 
UNIT-II VISUAL BASIC.NET | BCA
UNIT-II VISUAL BASIC.NET | BCA
Raj vardhan
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.net
Jaya Kumari
 
Variables in Visual Basic Programming
Variables in Visual Basic Programming
Kasun Ranga Wijeweera
 
Ch (2)(presentation) its about visual programming
Ch (2)(presentation) its about visual programming
nimrastorage123
 
Learning VB.NET Programming Concepts
Learning VB.NET Programming Concepts
guest25d6e3
 
Variable scope ppt in vb6
Variable scope ppt in vb6
AmanHooda4
 
Visual Programming
Visual Programming
Bagzzz
 
Visual Basics for Application
Visual Basics for Application
Raghu nath
 
Visual basic intoduction
Visual basic intoduction
mohamedsaad24
 
different data types used in programming VB .pptx
different data types used in programming VB .pptx
meemee7378
 
.NET Variables and Data Types
.NET Variables and Data Types
LearnNowOnline
 
E learning excel vba programming lesson 3
E learning excel vba programming lesson 3
Vijay Perepa
 
object oriented fundamentals in vb.net
object oriented fundamentals in vb.net
bantamlak dejene
 

More from abacusgtuc (6)

Introduction to Visual Basic Programming
Introduction to Visual Basic Programming
abacusgtuc
 
network-security_for cybersecurity_experts
network-security_for cybersecurity_experts
abacusgtuc
 
Cybersecurity_Security_architecture_2023.pdf
Cybersecurity_Security_architecture_2023.pdf
abacusgtuc
 
ch04_network-vulnerabilities-and-attacks.pdf
ch04_network-vulnerabilities-and-attacks.pdf
abacusgtuc
 
psychology of everyday things_and_design_concepts.ppt
psychology of everyday things_and_design_concepts.ppt
abacusgtuc
 
Information Security Planning and Risk Analysis
Information Security Planning and Risk Analysis
abacusgtuc
 
Introduction to Visual Basic Programming
Introduction to Visual Basic Programming
abacusgtuc
 
network-security_for cybersecurity_experts
network-security_for cybersecurity_experts
abacusgtuc
 
Cybersecurity_Security_architecture_2023.pdf
Cybersecurity_Security_architecture_2023.pdf
abacusgtuc
 
ch04_network-vulnerabilities-and-attacks.pdf
ch04_network-vulnerabilities-and-attacks.pdf
abacusgtuc
 
psychology of everyday things_and_design_concepts.ppt
psychology of everyday things_and_design_concepts.ppt
abacusgtuc
 
Information Security Planning and Risk Analysis
Information Security Planning and Risk Analysis
abacusgtuc
 
Ad

Recently uploaded (20)

Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
Ad

CHAPTER 2 (Data types,Variables) in Visual Basic Programming

  • 2. Variables and Data Types • A variable is a letter or name that can store a value. More technically we can define a variable as a pointer to a block of memory that stores information. • When you create computer programs, you can use variables to store numbers, such as the height of a building, or words, such as a person's name. Simply put, you can use variables to represent any kind of information your program needs.
  • 3. • You might ask, "Why use a variable when I could just use the information instead?" As the name implies, variables can change the value that they represent as the program is running. • The information that is stored in a variable is of a certain data type. • That data may be an integer like "23", a floating point number like "23.23", a string like "Hello World!", and many other data type. Variables and Data Types
  • 4. Using a Variable To use a variable, you must give it a name. There are rules you should, and usually must, follow when naming your variables. The name of a variable: • Must begin with a letter • Cannot have a period (remember that we use the period to set a property; in other words the period is an operator) • Can have up to 255 characters. Please, just because it is allowed, don't use 255 characters. • Must be unique inside of the procedure or the module it is used in.
  • 5. Good habits with variables For the sake of making sure other people can look at your code and know what you were thinking: • Prefix your variable name with the appropriate prefix for your variable's data type. • Make sure the body of your variable name makes it easy to tell what its used for. • Don't use an ambiguous name like "intBlabla" or "strX" unless its use is within a very small scope of the program, and even then try not to do it much. Try using descriptive names. For example, IntTotSalary to design the total of a salary.
  • 6. Visual Basic Data Types Visual Basic type Common language runtime type structure Value range Boolean Boolean True or False Byte Byte 0 through 255 (unsigned) Char (Single character) Char 0 through65535 (unsigned) Date Date and Time 0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December 31, 9999 Decimal Decimal - Double Double - Integer Int32 -2,147,483,648 through 2,147,483,647 Long (long integer) Int64 -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807
  • 7. Visual Basic type Common language runtime type structure Value range Object Object (class) Any type can be stored in a variable of type Object SByte SByte -128 through 127 Short (short integer) Int16 -32,768 through 32,767 Single single - String (Variable length) String (class) 0 to approximately 2 billion Unicode characters UInteger UInt32 0 through 4,294,967,295 ULong UInt64 0 through 18,446,744,073,709,551,615 UShort UInt16 0 through 65,535 Visual Basic Data Types
  • 8. There are two principle ways to add variables to your applications. • implicit declaration : is to let Visual Basic automatically create the variable for you. For an implicit declaration, Visual Basic automatically creates a variant for each identifier it recognizes as a variable in an application. • At first glance, this codes look the same. But because the tempVal variable is misspelled as the argument to Sqrt, the compiler creates an additional local variable called temVal, which is never assigned a value, and your function always returns zero. Declaring Variables (Implicit Declaration) Function safeSqrt(num) ' Make sure num is positive for square root. tempVal = Math.Abs(num) Return Math.Sqrt(tempVal) End Function Function safeSqrt(num) ' Make sure num is positive for square root. tempVal = Math.Abs(num) Return Math.Sqrt(temVal) End Function
  • 9. • The second approach to declaring variable is to explicitly declare them with one of the following keywords: Dim, Static, Private, and Public. The choice of keyword has a profound effect on the variable’s scope within the application and determines where the variable can be used in the program. By default, the Visual Basic compiler enforces explicit declaration (what I also strongly advice), which requires that you declare every variable before you use it. You can remove this requirement and permit implicit declaration. Declaring Variables (Explicit declaration) Function safeSqrt(num) Static tempVal as Integer ' Make sure num is positive for square root. tempVal = Math.Abs(num) Return Math.Sqrt(temVal) End Function ERROR MESSAGE
  • 10. Declaring Variables (Explicit declaration) • Now that you have an understanding of the allowable types in VB .NET, you need to learn how to use these types in your code. • To declare a variable, you use a variable declaration statement. The following is the basic syntax for variable declaration in VB .NET: • The following would be an example of the variations of the declaration statement: Dim intX as Integer Privat e intX as Integer Public intX as Integer Static intX as Integer Protected intX as Integer Friend intX as Integer [ Dim | Public | Protected | Friend | Protected Friend | Private | Static ] variablename As [ New type] = [expression]
  • 11. Variable defaults When you declare a variable of a type without assigning a value to it, the variable has a default value based on the type of variable you have assigned as the type. The following are the default values for different types:  Numbers: 0 (zero)  Boolean: False  String: Nothing  Object: Nothing  Date: 12:00:00 AM
  • 12. Constants • A constant allows you to use a friendly name for a variable value that does not change throughout the execution of your application. • Constants in Visual Basic .NET act exactly as they did in previous versions. • To declare a constant, you use the Const keyword within a procedure or at the declarations section of your classes or modules. • Constants can be declared with the scope of Private, Public, Friend, Protected, or Protected Friend. • The following is the usage of the Const statement: [Public | Private | Friend | Protected | Protected Friend ] Const constantname As [ New type ] = [expression]
  • 13. • When you declare a constant, you must declare it as a certain type. • Constants can be declared as Boolean, Byte, Char, DateTime, Decimal, Double, Integer, Long, Short, Single, or String data types. • In the following code, you are declaring several constants and then using them in the procedure within the module. Constants Module Module1 Private Const BillsSalary As Double = 10,000 Private Const MySalary As Byte = 1,000 Private Const strMsg As String = "Try Again Please" Private Function Test_Salary() As Boolean If MySalary > BillsSalary Then Console.WriteLine(strMsg) End If End Function End Module