Professional Documents
Culture Documents
constants cannot
3- 2
3- 3
3- 4
Boolean
Byte (0 to 255)
Char
Date
String
Decimal
Object
Short (-32,768 to 32,767)
Integer
(-2,147,483,648 to
2,147,483,647)
Long (larger whole
numbers)
Single (floating point accuracy to 6
digits)
Double
(floating point accuracy to 14
points)
3- 5
Boolean 2 bytes
Byte 1 byte
Char 2 bytes
Date 8 bytes
String varies
Decimal 16 bytes
Object 4 bytes
Short 2 bytes
Integer 4 bytes
Long 8 bytes
Single 4 bytes
Double 8 bytes
3- 6
Boolean bln
Byte byt
Char chr
Date dat
String str
Decimal dec
Object depends
on type of object
Short sht
Integer int
Long lng
Single sng
Double dbl
3- 7
Dim decPayRate
Initialization
Dim datHireDate
Dim blnInsured
Dim lngPopulation
As String
As Short
As Decimal
= 8.25
As Date
As Boolean
As Long
Const decDISCOUNT_RATE
As Decimal
Fixed
= .15
Note:Constantsarenamedusingalluppercase
lettersEXCEPTtheprefix.
3- 8
3- 9
3- 11
Function
To
CInt **
CDec
CStr
Convert
Integer
Decimal
String
**CIntroundstothenearestEvenNumber
3- 12
intQuantity
decPrice
intWholeNumber
decDollars
strValue
=
=
=
=
=
CInt(txtQuantity.Text)
CDec(txtPrice.Text)
CInt(decFractionalValue)
CDec(intDollars)
CStr(decValue)
Function
Name
Argument
ToBeActedUpon
3- 13
Computers solve math formulas based on a specific order 1st, then left to
right
1. Parentheses
2. Exponentiation
3. Multiplication & Division
/
\
4. Integer Division
5. Modulus
Mod
+
3- 14
3+4*2=11 Multiplythenadd
(3+4)*2=14 Parenthesescontrol:addthenmultiply
8/4*2=4
Samelevel,lefttoright:dividethenmultiply
3- 15
Message to display
Optional Title Bar Caption
Optional Button(s)
Optional Icon
3- 16
MessageBoxIcon.Exclamation)
3- 17
TheMessageBoxisanOverloaded
Method
Overload:Whenamethodhasseveral
argument,thatistherearemultiple
Signaturestochoosefrom
ASignaturecorrespondtothean
Argumentlist
Argumentsmustbeincludedto
exactlymatchoneofthepredefined
Signatures
3- 18
OK
OKCancel
RetryCancel
YesNo
YesNoCancel
AbortRetryIgnore
3- 19
Asterisk
Error
Exclamation
Hand
Information
None
Question
Stop
Warning
3- 20
LECTURE 3