Or from the FAQ...

The above example is fine if you're running KiX 4.xx, but for KiX 3.6x, you need to specify $FileName = Dir("C:\TEMP\*.*") instead.

If (GetFileAttr($basedir+"\"+$name) & 16) will filter out files, showing only folders. Add a NOT to it and you filter out folders, showing only files.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.