Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | disk.folder.tree SEARCH    

  Functions
disk.dialogBox.folder
disk.dialogBox.open
disk.dialogBox.save
disk.dialogBox.save.getFilter
disk.drive.freeSpace
disk.drive.label
disk.drive.list
disk.drive.sysName
disk.drive.totalSpace
disk.drive.type
disk.file.compress
disk.file.copy
disk.file.date.get
disk.file.date.set
disk.file.delete
disk.file.exists
disk.file.expand
disk.file.list
disk.file.load
disk.file.load.array
disk.file.load.array.append
disk.file.load.decode
disk.file.merge
disk.file.move
disk.file.save
disk.file.save.array
disk.file.save.array.encode
disk.file.save.encode
disk.file.size
disk.folder.create
disk.folder.delete
disk.folder.exists
disk.folder.list
disk.folder.remove
disk.folder.setAsSystem
disk.folder.tree

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
disk.folder.tree

Language: MioScript
Product: MioFactory


Syntax

disk.folder.tree(path, variableName, callBackFunction)


Parameters

STRINGpathPath to the folder.
VARvariableNameName of a variable where to store the list of folders.
CALLBACKcallBackFunctionOptional.
Name of a function to be called each time a folder is found.


Return value

Boolean



Description

Builds an array with the list of all the sub-folders found in the specified folder.
The function browses up to 15 levels of sub-folders.

Depending on the number of folders, it can take several minutes to the function to proceed the request.
When specified, the callback function is called each time a folder is found. The number of folders already found is passed as the first parameter of the callback function, and the full path to the folder as the second parameter.
Using the callback function, you can display an information to the user about the progression of the operation.

If you want to retrieve only one level of sub-folders: disk.folder.list




MioScript Sample Code

event.load
    ...
    disk.folder.list(&path, myArray, myFunction)
    for(&ptr, 0, var.array.count(myArray)
        log("Folder " + &myArray[&ptr])
    for.next
event.end

function.myFunction(&folderCount, &folderPath)
    log(&folderCount" folder(s) found")
function.end