This may be quite useful to people: Shows how to get all the files matching a pattern in the directory and all subdirectories
USING System.IO.*.
DEF VAR myfiles AS CHAR EXTENT .
MyFiles = Directory:GetFiles("c:\temp", "*.jpg", SearchOption:AllDirectories).
MESSAGE EXTENT(MyFiles) SKIP MyFiles[1] VIEW-AS ALERT-BOX.
This works just fine, except when Directory:GetFiles returns a valid, yet empty string array. In that case you will get an error assigning this to the MyFiles extent: "Uninitialized array used as source of assignment. (14906)".
One way out of this is to check if Directory:GetDirectories(...):Length = 0.