Sub Main
Dim Nu(5),Cad(5),aN(5),Nu2(1),Nn2,Rsl(5)
Dim Sfile,T,V
Sfile = GetDirectoryAppData & "archiviovincicasa2.txt"
Call ApriBaseDatiFT(Sfile,5,",",40)
Ini = 1
fin = EstrazioniArchivioFT
Scrivi "********* Lotteria VinciCasa ********* Estratti ********************* Caduti ******************* ",1,,,1,2
T = Array(T,"Data info","Estratti","I","II","III","IV","V","Liv","Rit","RitSncLiv","C1","C2","C3","C4","C5","LivCad","CadProgress","EsitiFin","RsL / Rit","PresTeoF2","Att2")
Call InitTabella(T)
For es = fin To Ini Step - 1
kk = 0
For p = 1 To 5
Nu(p) = EstrattoFT(es,p)
Cad(p) = EstrattoFT(es,p)
aN(p) = EstrattoFT(es,p)
If EstrattoFrequenzaFT(Nu(p),es,fin) > 1 Then Nu(p) = "-"
If EstrattoFrequenzaFT(Cad(p),es,fin) = 1 Then Cad(p) = "-"
If EstrattoFrequenzaFT(Nu(p),es,fin) = 1 Then k = k + 1
If Cad(p) <> "-" Then kk = kk + 1
If EstrattoFrequenzaFT(Nu(p),es,fin) = 1 Then kkk = kkk + 1
Next
rit = SerieRitardoFT(Ini,fin,aN,1)
ess = fin - es
Call VerificaEsitoFT(aN,fin,1,,,,est)
'............. Ritado di Livello .............................
Mem2 = 0
rslA = es'fin - rit
Nn2 = Split("0." & StringaEstrattiFT(rslA),".")
For p1 = 1 To 5
Nu2(1) = Nn2(p1)
rit2 = SerieRitardoFT(rsla + 1,fin,Nu2,1)'mio rdl
spA = SeriePrimaFT(rslA + 1,fin,Nu2,1)
If Mem2 <= spA Then Mem2 = spA
If Mem2 = rit2 Then Mem2 = rit2
Next
If k < 5 Then RslA = fin - Mem2
If k = 5 Then RslA = rit
If k < 5 Then Rit2 = fin - Mem2
If k = 5 Then Rit2 = rit
presTeo = Round((5*1) *(10/11) ^ ess,4)
' Att2 = Round((k/(k + presteo)),3)
Att2 = Round((Dividi(k,k + PresTeo)),3)
'---------------------------------------------------------------
att = Round(Dividi(RslA,ess),2)
decd = 55 - kkk
If k > 0 Then
V = Array(V,GetInfoEstrazioneFT(es),StringaEstrattiFT(es),Nu(1),Nu(2),Nu(3),Nu(4),Nu(5),k,ess,RslA,Cad(1),Cad(2),Cad(3),Cad(4),Cad(5),kk,kkk,est,att,PresTeo,Att2)
Call AddRigaTabella(V)
End If
For x = 3 To 7
Call SetColoreCella((x),6,0)
Next
Call SetColoreCella(8,4,0)
For xx = 11 To 15
Call SetColoreCella((xx),6,0)
Next
If V(9) > 0 And V(10) = 0 Then Call SetColoreCella(18,2,4)
k = 0
kk = 0
Next
Call SetTableWidth("100%")
CreaTabella
Scrivi "Script By Mike58",1,1,,1,3
End Sub