Results 1 to 2 of 2

Thread: [RESOLVED] [2005] While... Loop (Real Problem this time)

Threaded View

  1. #1

    Thread Starter
    Lively Member smart_phil_dude1's Avatar
    Join Date
    Jun 2005
    Location
    Behind You!
    Posts
    125

    Resolved [RESOLVED] [2005] While... Loop (Real Problem this time)

    I'm using a while loop and it works fine, but it uses an integer variable and at the end I made it increase by 1 each time it loops. the problem is that, the variable is used in the loop but it seems like the variable doesn't go up.

    ex:
    VB Code:
    1. Dim intLineNumber As Integer = 1
    2.  
    3. Private Sub Button2_Click()
    4.     While intLineNumber <= 5
    5.         Log1.Text = Log1.Text & vbNewLine & "Changing " & Form1.TextBox1.Lines.GetValue(intLineNumber - 1) & "..."
    6.         intLineNumber = intLineNumber + 1
    7.     End While
    8. End Sub

    "intLineNumber = intLineNumber + 1" has an effect on the While... Loop, as it doesn't continue infinitely, but it has no affect on the GetValue. What's the problem?


    Thanks,
    Phil.
    Last edited by smart_phil_dude1; Jan 24th, 2007 at 05:29 PM.
    Please Help Us Save Ana or donate now by going to Oneana.com

    Visit my Website at http://www.therealfantasy.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width