Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim wcl As wildcardlisting
Dim path As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
wcl.Initialize(Me,"wcl")
wcl.ClearLists
' It cleares the Dir- and Filelisting lists which will be used in Events
'
path = File.DirRootExternal
wcl.ListFolders(File.DirRootExternal, True, True, True)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub wcl_FilesAndFoldersFinish(DirListing As List, FileListing As List)
Log("wcl_FilesAndFoldersFinish("&DirListing.Size&","&FileListing.Size&")")
For i = 0 To DirListing.Size -1
'Log(DirListing.Get(i))
Next
For i = 0 To FileListing.Size -1
Log(FileListing.Get(i))
Next
End Sub
Sub wcl_DirListingError(error As String)
Log("wcl_DirListingError("&error&")")
End Sub
Sub wcl_ListFilesFinish(FileListing As List)
Log("wcl_ListFilesFinish("&FileListing.Size&")")
For i = 0 To FileListing.Size -1
Log(FileListing.Get(i))
Next
End Sub
Sub wcl_ListFoldersFinish(DirListing As List)
Log("wcl_ListFoldersFinish("&DirListing.Size&")")
Dim maxlevel As Int = 0
For i = 0 To DirListing.Size -1
Dim count As Int
Dim dir As String = DirListing.Get(i)
dir = dir.SubString(path.Length)
Dim m As Matcher = Regex.Matcher("/", dir)
Do While m.Find
count = count +1
Loop
maxlevel = Max(count,maxlevel)
Next
Log("MaxLevel: "&maxlevel)
End Sub