Sub DownloadTurno()
DateTime.DateFormat = "dd/MM/yyyy"
NomeFileTurno = NomeMese & (Anno Mod 2000) & ".TEL"
Try
'copio il File del mese dalla cartella di Dropbox alla cartella Files/Turni Telecontrollo della mia app
dbxFiles.download(File.Combine(DirTurni_DropBox,NomeFileTurno), DirDestination, NomeFileTurno)
'finche non sono certo che il download è terminato ed è pieno, aspetto
If File.Exists(DirDestination, NomeFileTurno) Then
Do While File.size(DirDestination, NomeFileTurno)=0
Log("passaggioDownload")
Loop
End If
Catch
LogColor("Errore nella routine 'downloadTurno' " & CRLF & LastException,Colors.green)
'Return False
End Try
End Sub
Do While RicavaRigheTurni = False
Log("aspetto")
Loop
Sub RicavaRigheTurni As Boolean
Dim i As Int
Dim ListaRighe As List
ListaRighe=File.ReadList(DirDestination, NomeFileTurno)
If ListaRighe.Size=0 Then Return False
For i = 0 To 5
RigaTurno(i) = ListaRighe.Get(i)
Next
Return True
End Sub