Академический Документы
Профессиональный Документы
Культура Документы
These two programs will show the loop feature in Visual Basic.
First I will show the screen shots of my programs and then the
Code.
1)
B=1
Do Until B = 4
MsgBox(B)
B=B+1
Loop
The above code shows the looping feature of VB and below is
the code for the three buttons:
2) Now the second example. This program will show the
features of conditional statement:
If CHBOption1.Checked Then
PBBar1.Value = PBBar1.Value + 1
PBBar1.Value = PBBar1.Value - 1
End If
TmrRun.Enabled = False
End If
Integer Holds 32 bit integers that The value I am using Dim Animals As Integer
4Bytes
range does not contain Animals = 37500000
from the value of fractional numbers
-2,147,483,648
Through 2,147,483,647
String Variable length string Strings are used when Dim Wolf As String
Depends on
can hold from text is involved Wolf = "starter"
0 to 2 billion characters platform
Single 32 bit number ranging When fractional numbers Dim Price As Single
4Bytes
from -3.4028235E38 are used with this range, Price = 699.99
through 3.4028235E8 this data type is most
efficient to use
Only has true states . Normally used for Private Sub Text3_Change()
Boolean Depends on
which are true and false example when you only Dim a Enable As Boolean
platform
want one command to be
enabled