Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on ln in a for/next loop
#1
Not sure why this is throwing an error

    For ln = 1 To 50
        Print ln, SpeedFactor(ln), Speed(ln)
    Next

The error line is the For ln = 1 to 50. The error reads "Unsupported variable used in the For statement"

The "l" in the "ln" is a lower case L and not the number 1.

If I change it to For n = 1 to 50, it's fine ... no error



The other curious thing about this is, if the loop was just to Print the value of  "ln" (ie For ln = 1 to 50: Print ln: Next) it runs fine, no error. So is the error actually the loop control "ln" or is it balking at the other two .. SpeedFactor(ln) or Speed(ln) both of which are correctly calculated prior to this print routine.

Again, this is not a big deal, all I need to do is change the loop control to just n,  just curious why
Reply


Messages In This Thread
Question on ln in a for/next loop - by Dimster - 09-12-2024, 03:59 PM
RE: Question on ln in a for/next loop - by Petr - 09-12-2024, 05:25 PM
RE: Question on ln in a for/next loop - by LEM - 09-12-2024, 05:44 PM
RE: Question on ln in a for/next loop - by bplus - 09-13-2024, 12:45 AM
RE: Question on ln in a for/next loop - by bplus - 09-13-2024, 04:43 PM
RE: Question on ln in a for/next loop - by Pete - 09-13-2024, 06:23 PM
RE: Question on ln in a for/next loop - by bplus - 09-13-2024, 10:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  _Putimage Question. Pete 11 672 01-04-2026, 09:33 PM
Last Post: Pete
  Nice simple, I hope, question Mad Axeman 4 335 12-20-2025, 09:28 PM
Last Post: SMcNeill
  Exiting sub while inside a loop PhilOfPerth 5 507 12-05-2025, 09:40 AM
Last Post: PhilOfPerth
  NewBie Question niteflyer 2 329 11-06-2025, 07:11 PM
Last Post: Petr
  A Question About _MAPTRIANGLE Magdha 2 374 11-02-2025, 11:37 AM
Last Post: Magdha

Forum Jump:


Users browsing this thread: