Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Each classification of Data Type has more than onetype.


Each data type occupies a storage space in the memory: for example, the integer data type
occupies 4 bytes of memorystorage.
 Each data type has a range of values (minimum value and maximum value); for example, the
range of values the data type (Byte) starts with ‘0’ and ends with‘255’.

They are places reserved in (RAM) that have data types; on declaring them, name and
data types are determined for them. They take a fixed value and do not change during the
progress of the program, such as: some mathematical constants like π, or some of the
constants in physics like gravity acceleration, the speed of light and the speed of sound .etc.

On naming constants and variables preferably name expressing its purpose so that:
1. Variable names must begin with a letter or underscore(_).
2. Variable names should not contain symbols or special characters (e.g.: ?,*,^, -, +,.etc.).
3. Do not use reserved words (Visual Basic.NET Language Keywords) such as (single, Dim,As).

It also must be the choice of the appropriate type of each of the constants and variables -
which had been clarified in data types to commensurate with the nature of the data to bestored.

Use the (Const) in the declaration of the constants in the language of the VB.NET, as
illustrated in the following syntax:
Const Constant name As Data Type = Value
where:-
Const: decleration command about constants
Constant_Name: the name of the constant.
Data type : the type of data stored in the constant .
Value : the constant value that stored in the declared constant .

"=StringAsC_NameConst‫ "جمهورية مصرالعربية‬


Meaning of code: the constant (C_Name) was declared, of data type (String) and, its text value
"‫"ال عربية مصرجمهورية‬isassignedduringthedeclaration.

 Const pi As Single = 22 / 7 OR Const pi as signle=3.14


Meaning of code: the constant (pi) was declared, of data type (Single) and, its numeric value
22/7 or 3.14 is assigned during the declaration.

 Const BirthDate As Date =#1/25/2011#


Complete:
7/60

You might also like