WinGet, NewIDs, List
OldIds := NewIds
Msgbox % OldIds1
Msgbox % NewIds1
return
First Msgbox is empty
Second has window's id
Need to know how to make a copy of NewIds contents to OldIds without having to loop through NewIds if that is possible.
Is there a simple way to copy a List's contents
Is there a simple way to copy a List's contents
Last edited by jwahk on 21 Jul 2017, 13:57, edited 1 time in total.
Re: How do I copy an array
Its not a real array but a list of sequentially named variables, you might as well call the WinGet line again but if you must copy it this should do it
Code: Select all
WinGet, NewIDs, List
Loop, % NewIDs
OldIds%A_Index%:=NewIds%A_Index%
Msgbox % OldIds1
Msgbox % NewIds1 ; a real array would be called like so: NewIds[1]
return
Re: How do I copy an array
Thank you. I was hoping there was a simpler way than doing a loop like x := y.Guest wrote:Its not a real array but a list of sequentially named variables, you might as well call the WinGet line again but if you must copy it this should do itCode: Select all
WinGet, NewIDs, List Loop, % NewIDs OldIds%A_Index%:=NewIds%A_Index% Msgbox % OldIds1 Msgbox % NewIds1 ; a real array would be called like so: NewIds[1] return
Re: Is there a simple way to copy a List's contents
I think your missing the point of what guest was trying to explain.NewIDs contains nothing
NewIDs1 does its a separat variable for each item in the list
NewIDs1 does its a separat variable for each item in the list
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter