Sean
VB6 Reference Sheet
Varlable Declaration
Dim As
Data Types
Boolean Byte, Curency. Date, Double, integer, Long. Object, Single
‘ttn, Variant
“Type Declaration
Dim
suffixes
%6- Integer $- Sting. @ - Curency, & - Long. # - Double | - Single
Comments
‘Use the apostrophe hike this.
Arithmetic Operators
“(ad -(subtract, mulipy), (sie), Vinteger dvi),
Mociremainder), Ypower)
Logical Operators
AND, NOT OR, XOR, IS, EQ, IMP, LIKE
Comparision Operators.
(equal fo), <>(not equal'o), (@reater than), <=(lessar
than or equal to) >=(areater than or equal to)
Bitvise Operators
AND, OR, NOT, XOR
\Fietse
I condton>) Then
ise
“statomonts>
End
Intine F
variable = F(., )
Case Statement
Select Case()
Case())
statoments>
(Case (
ase()
estatoments>
Case Else]
End Select
For Loop
For = To [Step ]
“statements>
Next fecounter>)
o-while Loop
Do Whie()
“statoments>
Loop
o-Loop- while
De
“statements>
Loop Whie()
Do-Untt Loop.
Do Unty)
Loop
Do-Loop-Until
Do
Loop Unt expression»)
While-Wend Loop
Whie
Wend
For-Each
For Each In
“statoments>
(Next feslemant>)
arrays
Dim (
‘Dim ( To ) As
‘change Array Length
‘ReDim («Maxindexval>)
Procedures
[PrvaterPubie} Sub ()
statoments>
End Sub
Functions
[Prvete/Pubic] Function (
‘tatoments>
Name>=retum_value
End Function
Argument List
‘SubvFunction (Optonal] argument! as Type, argument? as
Type.)
Cling Procedures/Functions
[al] ((Argumenitish)
File Handling
OPEN for as
‘mode: INPUT. OUTPUT, APPEND
For reading elds from a file nto variables
INPUT , esting, vanable>
For Writing Data
WRITE #7, Data with quotes
PRINT #1, Data without quotes
‘To Close the Data File:
CLOSE
‘Simple Error Handling
‘On Error Galo
‘On Error Gata