Sub CopyMapToDownload(Folders() As String, Filename As String)
Dim extfolder As ExternalFile
Dim extfile As ExternalFile
Storage.SelectDir(True)
Wait For Storage_ExternalFolderAvailable
Dim mapfound As Boolean = False
Dim extfolder As ExternalFile = Storage.FindFile(Storage.Root, Folders(0))
If Folders.Length > 1 Then
For i = 1 To Folders.Length -1
extfolder = Storage.FindFile(extfolder, Folders(i))
Next
End If
If extfolder.IsInitialized Then
Dim extfile As ExternalFile = Storage.FindFile(extfolder, Filename)
If extfile.IsInitialized Then
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, Starter.MapTempDestination, False)
mapfound = True
End If
End If
If Not (mapfound) Then
Dim msg As String = "Map " & Filename & " not found!"
Msgbox2Async(msg, "Missing Map", "OK", "", "", Null, True)
End If
End Sub