Sub Main
Dim T,T2,T1,T3,T4,T5,T6,T7
Dim A,B,C,D,E,X,Y,R
Dim N1,N2,N3,N4,N5,N6,N7,N8,N9,N10
Dim A2,B2,C2,D2
Dim S1,S2,S3
'
'rk = InputBox("1numero")
rs = InputBox("Quante estrazioni vuoi controllare?",,0)
k = 0
For es = EstrazioneFin - rs To EstrazioneFin
AvanzamentoElab EstrazioneFin - rs,EstrazioneFin,es
For R = 1 To 10
'
A = Estratto(es,R,1)
B = Estratto(es,R,2)
C = Estratto(es,R,3)
D = Estratto(es,R,4)
E = Estratto(es,R,5)
'
'---------------------------------
ReDim MatriceCaselleDaEvid(5,1)
'
MatriceCaselleDaEvid(1,0) = R
MatriceCaselleDaEvid(1,1) = 1
'
MatriceCaselleDaEvid(2,0) = R
MatriceCaselleDaEvid(2,1) = 2
'
MatriceCaselleDaEvid(3,0) = R
MatriceCaselleDaEvid(3,1) = 3
'
MatriceCaselleDaEvid(4,0) = R
MatriceCaselleDaEvid(4,1) = 4
'
MatriceCaselleDaEvid(5,0) = R
MatriceCaselleDaEvid(5,1) = 5
Call DisegnaEstrazione(es,MatriceCaselleDaEvid)
'
T1 = Array(T1," "," "," "," "," "," "," "," ")
'Call InitTabella(T1)
'-------------------------------
'-------------------------------
T1 = Array(T1,Format2(A)," ",Format2(B)," ",Format2(C)," ",Format2(D)," ",Format2(E))
Call InitTabella(T1)
Call SetColoreCella(1,RGB(0,0,255),RGB(255,255,255))
Call SetColoreCella(3,RGB(0,0,255),RGB(255,255,255))
Call SetColoreCella(5,RGB(0,0,255),RGB(255,255,255))
Call SetColoreCella(7,RGB(0,0,255),RGB(255,255,255))
Call SetColoreCella(9,RGB(0,0,255),RGB(255,255,255))
'-------------------------------
'---------
N1 = Abs(A - B)
N2 = Abs(B - C)
N3 = Abs(C - D)
N4 = Abs(D - E)
'---------------------------------
If A < B And B > C And C < D And D > E Then
T2 = Array(T2," ",("+" & N1)," ",("-" & N2)," ",("+" & N3)," ",("-" & N4)," ")
Call AddRigaTabella(T2)
Call SetColoreCella(2,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(4,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(6,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(8,RGB(255,255,255),RGB(0,0,0))
Else
If A > B And B < C And C > D And D < E Then
T2 = Array(T2," ",("-" & N1)," ",("+" & N2)," ",("-" & N3)," ",("+" & N4)," ")
Call AddRigaTabella(T2)
Call SetColoreCella(2,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(4,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(6,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(8,RGB(255,255,255),RGB(0,0,0))
End If
End If
'--------------------------------
'-------------------------------
'---------
N5 = Abs(N1 - N2)
N6 = Abs(N2 - N3)
N7 = Abs(N3 - N4)
'---------------------------------
If N1 < N2 And N2 < N3 And N3 < N4 Then
T3 = Array(T3," "," ",("-" & N5)," ",("-" & N6)," "," ",("-" & N7)," ")
Call AddRigaTabella(T3)
Call SetColoreCella(3,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(5,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(7,RGB(255,255,255),RGB(0,0,0))
Else
'--------------------------------
T3 = Array(T3," "," ",("+" & N5)," ",("+" & N6)," ",("+" & N7)," "," ")
Call AddRigaTabella(T3)
Call SetColoreCella(3,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(5,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(7,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
End If
'---------
N8 = Abs(N5 + N6)
N9 = Abs(N6 + N7)
'---------------------------------
If N5 < N6 And N6 < N7 Then
T4 = Array(T4," "," "," ",("-" & N8)," ",("-" & N9)," "," "," ")
Call AddRigaTabella(T4)
Call SetColoreCella(4,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(6,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
Else
T4 = Array(T4," "," "," ",("+" & N8)," ",("+" & N9)," "," "," ")
Call AddRigaTabella(T4)
Call SetColoreCella(4,RGB(255,255,255),RGB(0,0,0))
Call SetColoreCella(6,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
End If
'---------------------------------------------
N10 = Abs(N8 + N9)
'
'
If N8 > N9 Then
'---------------------------------
T5 = Array(T5," "," "," "," ",("+" & N10)," "," "," "," ")
Call AddRigaTabella(T5)
Call SetColoreCella(5,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
Else
T5 = Array(T5," "," "," "," ",("-" & N10)," "," "," "," ")
Call AddRigaTabella(T5)
Call SetColoreCella(5,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
End If
'
'---------------------------------
T6 = Array(T6," "," "," "," "," "," "," "," "," ")
Call AddRigaTabella(T6)
Call SetColoreCella(5,RGB(255,255,255),RGB(0,0,0))
'--------------------------------
Call SetTableWidth("19%")
CreaTabella
Next
Next
End Sub