I can help in VB 6 if anyone needs help
Printable View
I can help in VB 6 if anyone needs help
hahaha good old visual basic, i remember the days when my teacher taught us this stuff in computer class, man that was highly boreing hahaha
Our teacher has been giving us so much work for VBasic!
i was asked to do loops and check em on VB can some1 check it for me plz
i need it by tomoz plz..
do while
========
-----------------------
Private Sub Command2_Click()
Dim i As Integer
Do While i < 100
i = i + 1
Loop
lbl1.Caption = i
End Sub
----------------------------
can i also write the code in the following manner?
------------------------
Private Sub Command3_Click()
Dim i As Integer
Do
i = i + 1
Loop While i < 100
lbl1.Caption = i
End Sub
--------------------------------
please let me know cuz i got even more
this is the Visual basics code
please let me know if its correct
==================
-------------------------------
Private Sub Command4_Click()
If txt1.Text = 1 Then
lbl1.Caption = "You Typed Choice 1"
Else
If txt1.Text = 2 Then
lbl1.Caption = "You Typed Choice 2"
Else
If txt1.Text = 3 Then
lbl1.Caption = "You Typed Choice 3"
Else
If txt1.Text > 3 Then
lbl1.Caption = "This choice is not available! Make ur choice from 1 to 3 ONLY!!"
End If
End If
End If
End If
End Sub
---------------------------------------
another part of my assessment was to do a do until loop, that was same as the do while i think, correct me if im wrong plz.
code:
--------------------------------
Private Sub Command1_Click()
Dim i As Integer
Do Until i = 10
i = i + 1
Loop
lbl1.Caption = i
End Sub
--------------------
You Can write code as below you can use simply txt in place of txt.text
If u want to convert it as number you must use type conversion like val()
Private Sub Command4_Click()
If txt1 = "1" Then lbl1.Caption = "You Typed Choice 1"
If txt1= "2" Then lbl1.Caption = "You Typed Choice 2"
If txt1= "3" Then lbl1.Caption = "You Typed Choice 3"
If val(txt1) > 3 Then lbl1.Caption = "This choice is not available! Make ur choice from 1 to 3 ONLY!!"
Select Case txt1.Text
Case "1"
lbl1.caption="You Typed Choice 1"
Case "2"
lbl1.caption="You Typed Choice 2"
case "3"
lbl1.caption="You Typed Choice 3"
Else Case
lbl1.Caption = "This choice is not available! Make ur choice from 1 to 3 ONLY!!"
End Select
i don't know
Private Sub Command1_Click()
List1.AddItem (Text1.Text)
End Sub
Private Sub Command1_Click()
Do While i <= 10
List1.AddItem (i)
i = i + 1
Loop
End Sub
Private Sub Text1_Change()
Label1.Caption = Text1.Text
End Sub
Private Sub Command1_Click()
Dim i, n As Integer
n = 12
List1.List(0) = "multiply"
i = 1
Do While i <= n
List1.AddItem (i & " x " & n & vbTab & "=" & i * n)
i = i + 1
Loop
End Sub
Private Sub Command1_Click()
Dim Num As Integer
Select Case Val(Text1.Text)
Case 80 To 100: MsgBox "Grade A" & vbCrLf & "Oh Very Good !"
Case 70 To 79: MsgBox "Grade B"
Case 60 To 69: MsgBox "Grade C"
Case 50 To 59: MsgBox "Grade D"
Case 0 To 49: MsgBox "Grade F" & vbCrLf & "Oh sorry You Fall"
Case Else: MsgBox "Sorry , Press your number Between 0 to 100"
End Select
End Sub
Source code and tutorial please check http://gratisbogor.wordpress.com