09-12-2024, 03:59 PM
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
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