Hi, I'm just learning to use arrays and I could use a spot of help.
I'm using Bryce's DirPlus() to build an array of all the files in a directory, then I'm trying to grab a random element of that array.
(I'm using Shawn's Randomize() to seed the RNG.)
I keep getting dinged out with "Error: Error in expression: this type of array not supported in expressions.!"
Will someone please give me a jump-start?
Code:
Break On
$dummy=SetOption('NoVarsInStrings','On')
$dummy=SetOption('Explicit','On')
Dim $FILE_ARRAY,$FILE_ARRAY_ELEMENT,$FILE_PATH
Randomize()
$File_Array=DirPlus('c:\windows\media') ;this directory is an example for the purposes of this post
$File_Array_Element=$File_Array(Rnd(Ubound($File_Array)))
? $File_Array($File_Array_Element) ;this is where the error occurs
Sleep 1
Quit
Here's the DirPlus() code in it's own post - I've not made any changes to the UDF in my script LINK
And here's the Randomize() code LINK
Best regards,
Tim ==