working with collection
Hi all. i need help
Please look at this code:
set fld = fso.getFolder ("C:\")
for i = 1 to fld.files.count
fileNames(i) = fld.files.Item(i).Name
It should put all file names in the the folder "C:\" into array fileNames. It returns 'object error' on the string with 'fld.files.Item(i).Name'. i tried many diferent ways, but the result is 'object error' when i apply to 'Item(i)'.
The only way i didn't try - as written in MSDN, because Robot doesn't have 'For Each' statement [img]images/icons/frown.gif[/img]
Strange thing is that it returns correct count of files in the folder (string 'fld.files.count').
How does this big clever program work with collections?...
Or maybe is there another way to get all file names in a given folder?
Re: working with collection
Ok, I've found a way to get files from a folder. There is a function 'Dir' in the Robot that gives one by one files from the given folder with a given mask.
The main problem is solved.
But if someone tells me what is the problem with collection i'll be glad.