Question Problem running the code

PJSantos100

New member
Joined
Apr 28, 2014
Messages
2
Programming Experience
3-5
Hi Guys, first of all let me say this forum is great and there are a lot of expert people here....

I'm facing a problem when i try to run my app. I have a code to click and extract info from a website and based on that information i need to do some calculations and send it again to the site, the code is working well but i need to put some messagebox in the middle to work (i started just to debug the code).
So let's say i have 3 main functions like (Calculation, Right and wrong)... When it does the calculation the app see if I'm right or wrong and base on that i'll call the right/wrong function.... then I'll come back to the calculation....

This is the calculation function: In the 1st and 3rd line its the messagebox that i placed just to debug ......
Private Sub calculos()

        MessageBox.Show("start calculos", "Inicio")

        System.Threading.Thread.Sleep(5000)

        MessageBox.Show("timer passed")


                 TextBox5.Text = Ultima_App


                Dim htmlElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")

                For Each el As HtmlElement In htmlElements ' Le o Bet Size do SITE
                    If el.GetAttribute("id").Equals("BetSizeInput") Then
                        TextBox2.Text = el.GetAttribute("value")
                    End If
                Next

                Ultimo_Val = CDbl(Val(TextBox2.Text))

                Dim allelements As HtmlElementCollection = WebBrowser1.Document.All

                Resultado = WebBrowser1.Document.GetElementById("LastBetInfoProfit").InnerHtml   
                TextBox3.Text = Resultado


                If Resultado > 0.0 Then
                    TextBox4.Text = "Acertou"
                    Call Acerto()
                ElseIf Resultado < 0.0 Then
                    TextBox4.Text = "Falhou"
                    Call Falha()
                End If

    End Sub


Anyone has a clue???
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,717
Location
Sydney, Australia
Programming Experience
10+
I have formatted your code snippet for readability. Please do so for us in future, i.e. use something like:

[xcode=vb]your code here[/xcode]

As for the issue, you haven't actually explained what it is. You've provided the relevant code, which is good, but you have really explained what you expect to happen and how that differs from what actually happens.
 

PJSantos100

New member
Joined
Apr 28, 2014
Messages
2
Programming Experience
3-5
I have formatted your code snippet for readability. Please do so for us in future, i.e. use something like:

[xcode=vb]your code here[/xcode]

As for the issue, you haven't actually explained what it is. You've provided the relevant code, which is good, but you have really explained what you expect to happen and how that differs from what actually happens.

Hello jm, thanks for the reply and next one I'll try to format it :).... So let me explain you .... i have a app which has 3 functions... (Calculos, Acerto , Falha).....
Starting on calculos: The app should read from the web certain value and compare with my prediction... if i'm righ i call acerto() , if i'm wrong it should call falha. In this falha/acerto i'm doing some calculation and after that i call again the function acerto().... Everything is working(but only with that message boxes in the middle!)

I've just place the messageboxes with debug propose, but the reality is when i remove the same the code simply doesn't work as expected...
 

Latest posts

Top Bottom