My code is thes:
for x = 1 to 100
textbox1.text = x
next
Even with a delay loop only the upper limit(100) shows in the texbox.
what am I doing wrong?
For Next LoopDisplaying the counter in a textbox
Page 1 of 1
9 Replies - 771 Views - Last Post: 11 September 2009 - 02:18 PM
Replies To: For Next Loop
#2
Re: For Next Loop
Posted 11 September 2009 - 10:06 AM
What are you using as a delay loop?
#3
Re: For Next Loop
Posted 11 September 2009 - 10:38 AM
#4
Re: For Next Loop
Posted 11 September 2009 - 10:44 AM
Did you change to TextBox.Text = y???
Delays can be busy loops, like counting to 1,000,000, or Thread.Sleep(500) which sleeps the thread for 500 milliseconds (half a second)
Delays can be busy loops, like counting to 1,000,000, or Thread.Sleep(500) which sleeps the thread for 500 milliseconds (half a second)
#5
Re: For Next Loop
Posted 11 September 2009 - 11:11 AM
mark.bottomley, on 11 Sep, 2009 - 09:44 AM, said:
Did you change to TextBox.Text = y???
Delays can be busy loops, like counting to 1,000,000, or Thread.Sleep(500) which sleeps the thread for 500 milliseconds (half a second)
Delays can be busy loops, like counting to 1,000,000, or Thread.Sleep(500) which sleeps the thread for 500 milliseconds (half a second)
Let me be more specific,
As an old basic programmer from the 80's it was a kick seeing numbers in a for next loop scrolling across the screen in a milisecond,
for x = 1 to 100
print x
next x
switching to visual basic has been painfull, but I'am finally getting it, execpt for this:
for x = 1 to 100
textbox1.text = x
next
still only shows the upper limit(100)
I know I'am missing really basic even if I won't use this loop.
#6
Re: For Next Loop
Posted 11 September 2009 - 12:21 PM
I believe you can use the sort function inside the loop to do what you want it to do.
#7
Re: For Next Loop
Posted 11 September 2009 - 12:45 PM
Hey,
Try this???
Try this???
Dim Num As Integer = 0 For i = 0 To 100 - 1 Step 1 'even know step 1 isn't necessary Num = Num + 1 Console.WriteLine(Num) Next
#8
Re: For Next Loop
Posted 11 September 2009 - 01:08 PM
80's - VB1/2/3 - 33MHz 386 - crap for a video card - interpreted Basic with slow operation.
Now - VB.Net - 3GHz Pentium - more power in graphics card than main CPU - JIT'd (Just-In-Time compiled) code, optimized. The 100 digits are appearing, but faster than the 60-120Hz video refresh - blink faster!
Now - VB.Net - 3GHz Pentium - more power in graphics card than main CPU - JIT'd (Just-In-Time compiled) code, optimized. The 100 digits are appearing, but faster than the 60-120Hz video refresh - blink faster!
#9
Re: For Next Loop
Posted 11 September 2009 - 02:08 PM
mark.bottomley, on 11 Sep, 2009 - 12:08 PM, said:
80's - VB1/2/3 - 33MHz 386 - crap for a video card - interpreted Basic with slow operation.
Now - VB.Net - 3GHz Pentium - more power in graphics card than main CPU - JIT'd (Just-In-Time compiled) code, optimized. The 100 digits are appearing, but faster than the 60-120Hz video refresh - blink faster!
Now - VB.Net - 3GHz Pentium - more power in graphics card than main CPU - JIT'd (Just-In-Time compiled) code, optimized. The 100 digits are appearing, but faster than the 60-120Hz video refresh - blink faster!
Mark,
thought that might be the case,
but when your my age it's hard to blink faster.
I didn't anyone even rembered a 33Mhz 386.
thanks for your time.
wgp
#10
Re: For Next Loop
Posted 11 September 2009 - 02:18 PM
I have my original IBM PC in the basement - 4.77 MHz and needed a bios upgrade to support the EGA card and 10MB hard disk. I can also find my old Timex ZX81 if necessary. This was long after I stopped using punch cards and Fortran.... those were the days
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|