Sub Main()
Dim frequenze(450,3)
Dim ruota
Dim p
Scrivi "STATISTICA MENSILE ESTRATTI",2,,4,,4
'MESE DI RICERCA
ms = Mese(EstrazioneFin)
msr = InputBox("Scegli il Mese di ricerca - 0 per TUTTI -",,ms)
If msr > 0 Then
period = " di " & MeseNome(msr)
Else
period = "ciclo continuo"
End If
'RUOTA DI RICERCA
ruota = InputBox("Ruota di ricerca ",,1)
Scrivi " al " & DataEstrazione(EstrazioneFin) & " " & period,1,,3,,4
For i = 1 To 450
frequenze(i,2) = 0
Next
Scrivi" Ruota di " & NomeRuota(ruota),1,,3,,4
For n = EstrazioneFin - 416 To EstrazioneFin' Un anno 208 Estrazioni, due 416
If msr > 0 Then
If Mese

= Mese(msr) Then
For p = 1 To 5
e = Estratto(n,ruota,p)
frequenze(e +(p - 1)*90,2) = frequenze(e +(p - 1)*90,2) + 1
Next
End If
Else
For p = 1 To 5
e = Estratto(n,ruota,p)
frequenze(e +(p - 1)*90,2) = frequenze(e +(p - 1)*90,2) + 1
Next
End If
Next
For i = 1 To 90
For p = 1 To 5
frequenze(i +(p - 1)*90,1) = i
frequenze(i +(p - 1)*90,3) = p
Next
Next
OrdinaMatrice frequenze,- 1,2
Scrivi " Num.Freq.Pos. ",2,,4,,4
ScriviMatrice frequenze,0,5
End Sub