Function getCategoryList() As Object
list = m.filesystem.getdirectorylisting("ext1:/")
cl = createobject("roArray",list.count(),true)
for each folder in list
cl.push(folder)
end for
categoryList = cl
return categoryList
End Function
"BinaryMadman" wrote:
Thanks for the tip. I was trying to do it blinded without using Print calls. :oops: Turns out i didn't set up the roFileSystem to have a message port. It is now showing categories based on the names of folders on the external drive.
m.filesystem = CreateObject("roFilesystem")
m.filesystem.SetMessagePort(m.port)
"destruk" wrote:
You wouldn't be able to use the filesystem if you didn't have an object reference to it. So no, the messageport wouldn't change anything in this case. 🙂
"BinaryMadman" wrote:
How do i traverse through an array of associative arrays (Content Meta-Data)? I think know i use Screen.GetContentList() and assign it to a variable to get them but what is the syntax for accessing a specific array and a specific associative array?
I understand if the mods split this into another thread.
; Typed from memory. Sorry for any syntax errors.
; Access arrays with an integer index
; access associative arrays with string index when using a variable as the key or dot formation if you already know they key
; Variable access to associative array within an array
for index = 0 to array.Count()-1
for each key in array[index]
print "array[" ; index ; "][" ; key ; "] = "; array[index][key]
end for
end for
; Keep in mind that many content meta-data elements are themselves arrays or associative arrays, which you'll need to add another level of access.
; Here's an example of accessing an associative array within an array where you know the key
for index = 0 to array.Count()-1
print array[index].Title; " "; array[index].Url;
end for