Public Sub MyScriptRoutine()
' SCRIVERE QUI IL PROPRIO CODICE COME SE FOSSE LA SUB MAIN DI SPAZIOMETIRA
Dim aTest(10, 2) As Long
Dim aRet As Variant
Dim sRet As String
Dim k As Long, e As Long
For k = 0 To 10
For e = 0 To 2
aTest(k, e) = NumeroCasuale(1, 90)
Next
Next
For k = 0 To 10
sRet = ""
For e = 0 To 2
sRet = sRet & aTest(k, e) & "."
Next
Scrivi(sRet)
Next
Scrivi()
aRet = OrdinaMatrice(aTest, "0,1") ' si puo passare anche un array
For k = 0 To 10
sRet = ""
For e = 0 To 2
sRet = sRet & aRet(k, e) & "."
Next
Scrivi(sRet)
Next
Dim aR(11) As Long, idMese As Long = 3, ord As Long = -1
Dim R As Long
For R = 1 To 11
aR(R) = R
Next
Call GetEstrattiSuRuotaSingola(aR(), idMese, ord)
End Sub
Sub GetEstrattiSuRuotaSingola(aR() As Long, idMese&, ord&)
Dim idEstr&, idM&, s$, pres&, nR&
nR = UBound(aR)
Dim r As Long, p As Long, E As Long, id As Long
' per utilizzare matrice a 2 dimensioni sostituisco aStat(nR,90,14)
ReDim aStat(nR * 90, 14) As Long
ReDim aId(nR, 90) As Long
GetIdAppoggio(aR(), aId(), aStat()) ' questa funzione mi restituisce l indice del vettore dove coolocare i risultati
For idEstr = 1 To EstrazioniArchivio
idM = Month(DataEstrazione(idEstr))
For r = 1 To UBound(aR)
ReDim aE(5) As Long
Call GetArrayNumeriRuota(idEstr, aR(r), aE)
If aE(1) > 0 Then
For p = 1 To 5
E = aE(p)
id = aId(r, E)
aStat(id, idM) = aStat(id, idM) + 1
Next
End If
Next
Next
Dim aStatOrd As Variant = OrdinaMatrice(aStat, 3, -1)
For id = 1 To UBound(aStatOrd)
s = SiglaRuota(aStatOrd(id, 13)) & " " & Format2(aStatOrd(id, 14)) & " "
For E = 1 To 12
s = s & Format2(aStatOrd(id, E)) & " "
Next
Scrivi s
Next
End Sub
' arte dell arrangiamento dell accademia pasticcioni
Sub GetIdAppoggio(aRu() As Long, aId() As Long, aStat() As Long)
Dim i As Long, n As Long, k As Long
For i = 1 To UBound(aRu)
For n = 1 To 90
k + = 1
aId(i, n) = k
aStat(k, 13) = i ' numero Ruota
aStat(k, 14) = n ' estratto
Next
Next
End Sub