11 - 22
22 - 33
33 - 44
Thank you
Code: Select all
X1 = 11
X2 = 22
X3 = 33
X4 = 44
Loop, 3
{
;C := A_Index+1
MsgBox, % X%A_Index% " - " X%A_Index+1%
}
return
Code: Select all
X1 = 11
X2 = 22
X3 = 33
X4 = 44
Loop, 3
{
;C := A_Index+1
MsgBox, % X%A_Index% " - " X%A_Index+1%
}
return
Code: Select all
myData := [11, 22, 33, 44]
Loop, 3 {
msgbox, % myData[A_Index] " - " myData[A_Index + 1]
}
; => 11 - 22
; 22 - 33
; 33 - 44
Thank you very much for your help, I am working with dynamic variables, is there any way to work with them or rewrite the rest of the script and use arrays?Chunjee wrote: ↑08 Dec 2022, 02:18dynamic variables are so 2002; ahk has real arrays now.
Code: Select all
myData := [11, 22, 33, 44] Loop, 3 { msgbox, % myData[A_Index] " - " myData[A_Index + 1] } ; => 11 - 22 ; 22 - 33 ; 33 - 44
Code: Select all
X1 = 11
X2 = 22
X3 = 33
X4 = 44
Loop, 3
{
I2 := A_Index+1
MsgBox, % X%A_Index% " - " X%I2%
}
return