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



Users browsing this thread: 2 Guest(s)