I'm actually having some trouble now.
Trying to use named indexes to create an array of files and dependencies.
Basically the array should look like this:
Dependency1.esp => {
1 => {
1 => ParentFile1.esp,
2 => Description of dependency...
},
2 => {
1 => ParentFile2.esp
2 => Description of dependency...
}
},
Dependency2.esp => {
1 => {
1 => ParentFile1.esp,
2 => Description of dependency...
},
2 => {
1 => ParentFile2.esp
2 => Description of dependency...
}
},
etc...
I'm doing it like this:
Code:
; Create the parent array (name and description)
File := SA_Set(File, "ParentFile1.esp")
File := SA_Set(File, "Description of dependency...")
; Get the current parents if any exist
Dep1Files := SA_Get(Dependencies, "Dependency1.esp")
; Add to the current parents of this dependency
Dep1Files := SA_Set(Dep1Files, File)
; Set the dependency back into the main array
Dependencies := SA_Set(Dependencies, Dep1Files, "Dependency1.esp")
; Create a second parent array
File := ""
File := SA_Set(File, "ParentFile2.esp")
File := SA_Set(File, "Description of dependency...")
; Get the current parents if any exist
Dep2Files := SA_Get(Dependencies, "Dependency2.esp")
; Add to the current parents
Dep2Files := SA_Set(Dep2Files, File)
; Set the dependency back into the main array
Dependencies := SA_Set(Dependencies, Dep2Files, "Dependency2.esp")
MsgBox,% SA_Len(Dependencies)
The array only has one index instead of two.
I'm still trying to figure out exactly what is going wrong, but it seems to put everything underneath the first named index, never even creating the second. I can't seem to get past this using named indexes. I believe it works OK using standard numbered indexes however.