Now I want to select specific information and place it in a new array (but no connection to the original array)
eg. Array1 has img.name1 and img.name2 (and so on) but also img.info1 and img.info2
I want to create an new array tmpImg (no problem)
But only the information in img.name1 is copied to tmpImg.name1. (name1, name2, name3....)
After that tmpImg.name1 (and tmpImg.name2 and so on, can be changed without affecting img.name1, name2....
(Must a temp variable be used to cut the relation to the original array?)
Code: Select all
#Singleinstance force
; Create an array
img := []
img.name1 := "tst1"
img.name2 := "tst2"
img.info1 := "info1"
img.info2 := "info2"
; - - - - - - - - - - -
for k, v in Img
res .= "k.: " k "`t`tv.: " v "`n"
MsgBox % "1)`n" res
; - - - Array is created - - - - - - - - - -
tmpImg := []
for k, v in img
{ If k = name* ; Doesn't work
tmpImg.name1
}
res := ""
for k, v in tmpImg
res .= "k.: " k "`t`tv.: " v "`n"
MsgBox % "2)`n" res