how can i view the runtime execution of an infinite loop....????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vineet1987
    New Member
    • Nov 2009
    • 5

    how can i view the runtime execution of an infinite loop....????

    here is a small code:-

    Private Sub Command1_Click( )
    Dim i As Integer, j As Integer
    For i = 1 To 10000000
    For j = 1 To 10000000
    Print "SDFGH========= "; j
    Next j
    Next i

    End Sub


    when i click command1 in the form i want to view:
    SDFGH========== 1

    SDFGH========== 2
    .
    .
    .

    till
    SDFGH========== =10000000


    but i am unable to view the complete runtime execution...... ..
    please help so that i can see entire execution till SDFGG========== =100000000
    or let's assume till "infinity" in case if i don't want the loop to stop......infin ite loop
    but the visual basic.exe gives the message this program is not responding..... .
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to use higher data types not integer(try using LONG). Integer is not going to solve your problem and you will get overflow error.

    Comment

    • vineet1987
      New Member
      • Nov 2009
      • 5

      #3
      Originally posted by debasisdas
      You need to use higher data types not integer(try using LONG). Integer is not going to solve your problem and you will get overflow error.

      i want to print in my form let's say till 300 values in separate lines;
      but i can view only first 42 values as the form size is not that much.so how can i view all 300 values in separate lines in this case " integer" does not overflows

      MY main problem is not OVERFLOW but it is to view a large range of values in the form, as the form only shows few of the top values...

      i want the control from top to stop at the bottom(final value) and display in my form...

      Comment

      • vb5prgrmr
        Recognized Expert Contributor
        • Oct 2009
        • 305

        #4
        Use a list box and the additem method as you will never be able to produce a form long enough to display all those values and if this is the case then ignore my reply with the mod formula over at the other site.



        Good Luck

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Do as suggested in the post #4 or use Debug.Print instead of Print

          Comment

          Working...