Thread: help
View Single Post
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: help

 
0
  #6
Jan 5th, 2009
If you check the code I posted, you'll notice that I keep track of the LastNum (Last number) that X had been. You are not doing this. For x = n + 1 To n * 2 If n is always 3, x will always be from 3 to 6. Try it.. replace n with the number in the textbox. The for loop will always produce the same result. You need to somehow keep track of the last number that X was.... sort of like:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. For I = LastNum To NewNum
  2. print I
  3. Next I
  4.  
  5. LastNum = I
Then, you will have to calculate "NewNum" so you know how far you are supposed to loop until NewNum = LastNum + Val((Text1.Text) - 1). Furthermore, LastNum needs to be public (or static, but public is easier in this case).
Reply With Quote