Skip to content

Latest commit

 

History

History
45 lines (40 loc) · 2.9 KB

File metadata and controls

45 lines (40 loc) · 2.9 KB
title Constants and Enumerations in Visual Basic
ms.custom
ms.date 07/20/2015
ms.prod .net
ms.reviewer
ms.suite
ms.technology
devlang-visual-basic
ms.topic article
helpviewer_keywords
enumerations [Visual Basic]
Visual Basic code, constants
constants [Visual Basic]
object libraries, Object Browser
Visual Basic code, enumerations
declaring constants [Visual Basic], enumerations
naming conventions [Visual Basic], constants
Visual Basic code, improving readability with constants
ms.assetid c8aba36e-fa47-4a33-8b68-cb2009218270
caps.latest.revision 16
author dotnet-bot
ms.author dotnetcontent

Constants and Enumerations in Visual Basic

Constants are a way to use meaningful names in place of a value that does not change. Constants store values that, as the name implies, remain constant throughout the execution of an application. You can use constants to provide meaningful names, instead of numbers, making your code more readable.

Enumerations provide a convenient way to work with sets of related constants, and to associate constant values with names. For example, you can declare an enumeration for a set of integer constants associated with the days of the week, and then use the names of the days rather than their integer values in your code.

In This Section

Term Definition
Constants Overview Topics in this section describe constants and their uses.
Enumerations Overview Topics in this section describe enumerations and their uses.

Related Sections

Term Definition
Const Statement Describes the Const statement, which is used to declare constants.
Enum Statement Describes the Enum statement, which is used to create enumerations.
Option Explicit Statement Describes the Option Explicit statement, which is used at module level to force explicit declaration of all variables in that module.
Option Infer Statement Describes the Option Infer statement, which enables the use of local type inference in declaring variables.
Option Strict Statement Describes the Option Strict statement, which restricts implicit data type conversions to only widening conversions, disallows late binding, and disallows implicit typing that results in an Object type.