08-25-2023, 07:42 PM
(08-24-2023, 12:51 PM)DSMan195276 Wrote: It's becauseHey @DSMan195276 Since you used backticks, they work everywhere now to show as code inline like in discord. Also you can use 3 backticks for a regular qb codeblock.FORworks by first incrementing the loop variable and then checking if it is greater than the end value you gave. For your loop, the first timetis greater is when it is incremented to 11.
The reason it works this way is because depending on yourSTEPand what end number you use, you might not hit the last number at all and instead skip right over it. Imagine you did this:
Code: (Select All)
For t = 1 To 10.5 Step 1
Next
Print t ' What should t be?
Obviouslytcannot be 10.5 at the end because 10.5 will never be hit by the loop. Instead it works identical to your loop,tgets incremented to 11 and since that's greater than 10.5 the loop stops there.
Trying the reply to you since it's quoting the backticks to see what will happen
Thanks