Sub main()
Dim n(1),ru(1),nn(2)
k=CInt (InputBox ("Quante estrazioni vuoi controllare?",,360))
fin=EstrazioneFin
inizio=fin-k
Scrivi " STATISTICA DEGLI ESTRATTI CAPILISTA ED EX - Genal by Enplein" &chr(10) ,1
Scrivi "Archivio con inizio il "&fin-k&" a "&fin,1
Scrivi
'--------------------------------------------------------------------
For r=1 To 11
If r=11 Then r=12
ru(1)=r
n(1)=0
rs=0 : rsto=0
ini=fin-k
For es= ini To fin
Erase nn
x= PiuRitardatario (es,r)
If x<>n(1) Then
n(1)=x
ra=SerieRitardo (es-300,es,n,ru,1)
ok=0 : rs=0 : ex=0 : est=0
For i=1 To 200
x1= PiuRitardatario (es-i,r)
If x<>x1 Then : ok=1 : ini=es+i:nx=x1 : rs=es-i+1 : er=rs: Exit For
Next
If ok=1 Then
nn(1)=n(1) : nn(2)=nx
g=0 : riga=""
For j=1 To 200
sf=SerieFreq (er+j,er+j,nn,ru,1)
If sf>0 Then g=g+1 : ex=er+j : Exit For
Next
If g>0 Then
est=ex-rs : riga="Esito"
If est=>rsto Then rsto=est Else rst=rsto
End If
If g=0 Then
If rs<=fin Then est=fin-rs+1: riga="Rit. " Else est =0 : riga="Rit. "
If est=>rsto Then rsto=est Else rsto=rsto
ColoreTesto 1
Scrivi "DATA ESTR "& " |",1,0
Scrivi FormatSpace(SiglaRuota(r),5),1,0
Scrivi DataEstrazione(es)&"/"&es&" | CL ",1,0
Scrivi FormatSpace (x,3,1) & " Rit. "& FormatSpace (ra,3,1)&" ",1,0
Scrivi "Ex_CL "& FormatSpace (nx,3,1) &" Punto Ini. "& FormatSpace (rs,3,1)&" "&riga&" "& FormatSpace (est-1,3,1),1
ColoreTesto 0
Scrivi
End If
End If
End If
Next
Scrivi "DATA ESTR "& " |",1,0
Scrivi FormatSpace(SiglaRuota(r),5),1,0
Scrivi "In " &(fin-inizio)&" Estraz. Esito max = "& FormatSpace (rsto,2,1)&"°",1
Scrivi
Next
End Sub