Can you describe Above simple code?

DoEvent , VB6 , timers India
  • 11 years ago

    ///////////////////////////////////////////////////// Dim p As Integer 'Declared Globally Dim k As Integer 'Declared Globally ///////////////////////////////////////////////////// Private Sub Send_Click() p = 0 Do While p < (3*4) '3 is 3Sec SAP window Activation Delay.... DoEvents Loop

       For i = 1 To 12  
           dispcol (i)
       Next i

    End Sub

    Private Sub dispcol(i As Integer) k=0 Do While k<1 '1Sec delay to each value from grid row DoEvents Loop SendKeys "test"

    End Sub

    Private Sub Timer1_Timer() p = p + 1 If p > (Text1 * 4) Then p = 0 End If

    k = k + 1 If k > txtdl Then k = 0 End If End Sub

    The application has been coded to send key stroke to SAP window from VB application. The Application is like there is grid in VB form and user can send strings to SAP window(TextBoxes in SAP). I have used WIN API. Its woking fine but I did not understand above code By click on Send button I'm getting time of 3Sec to activate my SAP window and after 3Sec the values from grid Row are sending to SAP text boxes after every 1 sec

    Please can you Explain flow of code and use of Timer * *

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“You can stand on the shoulders of giants OR a big enough pile of dwarfs, works either way.”