Help with Visual Basic?? School Stuff

sonsofliberty

Rookie
Joined
Dec 29, 2006
Messages
36
Hey guys, if you know visaul basic, it would be great if you can help me out, not how to do it, but help me i guess.

You're suppose to input the numbers for number of blue, red marbles, and either a yes or no and for out come you get a fraction for probability for getting red/blue marbles


Public Class Form1
Dim
Dim input, replace, event1, event2 As String
Dim howmany, red, blue, numerator1, numerator2, denominator1, denominator2 As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Input = TextBox1.Text
howmany = Input.substring(0, 1)
Input = Input.remove(0, 2)
red = input.substring(0, input.Indexof(","))
input = input.remove(0, input.indexof(",") + 1)
blue = Input.substring(0, Input.indexof(","))
Input = Input.remove(0, Input.indexof(",") + 1)
If howmany = 1 Then
event1 = input
Else
Replace = Input.substring(0, 1)
event1 = input.Substring(0, 1)
event2 = input.Substring(0, 2)
End If
If replace = event1 Then denominator1 = red + blue Else denominator1 = red + blue - 1
If replace = event2 Then denominator2 = red + blue Else denominator2 = red + blue - 1
Label1.Text = input
 
Wow talk about bad timing i just deleted all my old visual basic stuff, cause like i though no one uses VB anymore.
 
[quote1193333055=Kahless[Jones]]
Wow talk about bad timing i just deleted all my old visual basic stuff, cause like i though no one uses VB anymore.
[/quote1193333055]



Actually, Visual Basic is still very popular in the industry amongst all of the old-timers who refuse to change.

In fact, according to the TIOBE Index, it is the 3rd most popular language, up from 5. So if anything, it is getting more popular.

As far as your question goes sonsofliberty, I have never used VB so I can't examine your code and see where the problem is. Maybe if you would be a little more specific with your question, some of us with general programming knowledge may be able to help you out.
 

Latest posts

Back
Top