Code: Select all
Loop,16
MsgBox % 5553 + A_Index + !Mod(A_Index,2)
I'm waiting for a result. But why doesn't this happen?"5554,5556,5558,5560,5562,5564,5566,5568,5570"
Code: Select all
Loop,16
MsgBox % 5553 + A_Index + !Mod(A_Index,2)
I'm waiting for a result. But why doesn't this happen?"5554,5556,5558,5560,5562,5564,5566,5568,5570"
Code: Select all
Loop,16
{
aa:=5553 + A_Index
if (Mod(A_Index,2))
e .= aa . "`r`n"
}
msgbox,%e%
exitapp
Your code works for me, however the sequence I get is not what you are apparently expecting. I get:hasantr wrote: ↑10 Jun 2022, 06:02In this processCode: Select all
Loop,16 MsgBox % 5553 + A_Index + !Mod(A_Index,2)
I'm waiting for a result. But why doesn't this happen?"5554,5556,5558,5560,5562,5564,5566,5568,5570"
I don't want to get these pairs. I want to get each result individually. I could do it the other way, but I guess I'm stuck. I want to get 16 results and they must have increased by twos. It would be great to be able to solve it in one line.RussF wrote: ↑10 Jun 2022, 06:32Your code works for me, however the sequence I get is not what you are apparently expecting. I get:hasantr wrote: ↑10 Jun 2022, 06:02In this processCode: Select all
Loop,16 MsgBox % 5553 + A_Index + !Mod(A_Index,2)
I'm waiting for a result. But why doesn't this happen?"5554,5556,5558,5560,5562,5564,5566,5568,5570"
5554, 5556, 5556, 5558, 5558, 5560, 5560, 5562, 5562...
which is correct, based on the logic of your code.
What are you expecting and not getting?
Russ
Code: Select all
MyVar := 5552
Loop, 16
MsgBox % MyVar += 2
Code: Select all
Loop, 16
MsgBox % 5552 + A_Index * 2