Thanks, Charles.
it will be useful for me to try to understand something of class
although I never remember the names of these functions
so everything I do is just basic of the basics
I use only for next, if then else, and some case, with arrays and variables, I get everything transformed into a big salad that only I understand but by some miracle it works in the vba
even conditional loops I use goto with if because I can never remember the "loop" functions
I tried something with array by reference but all the attempts caught
includepath "$/inc/"
$filename "Statistics_1.0.dll"
$dll
include "RTL32.inc"
extern export
Function Statistics(byref Resul[] as int, byval Cq as int, byval Ct as int, byval Lt as long)
', byref Tab_Atra() as int )
'sub Statistics( *Resul() as int,
' byval Cq as int,
' byval Ct as int,
' byval Lt as int,
' *Tab_Atra() as int )
indexbase 0
dim Tab_Atra() as int
dim C, L, Atr0() as int
dim n1 , n2 as double
dim int MAIOR_REPT, MAIOR_ATR
cq=cq-1
Ct=Ct-1
Lt=lt-1
Atr0(Ct)
For c = 0 To cq
Atr0((Resul)[L*cq+C]) = 1' Atr0(Resul(1, c)) = 1
Next
If Atr0(c) = 1 Then
Tab_Atra(L*cq+C) = 1
Atr0(c) = 0
Else
Tab_Atra(L*cq+C) = -1
End If
For L = 1 To lt
For c = 0 To cq
Atr0((Resul)[L*cq+C]) = 1
Next
For c = 0 To ct
n1=L*ct+C
n2=(L-1)*ct+C
If Atr0(c) = 1 Then
If Tab_Atra(n2) > 0 Then
Tab_Atra(n1) = Tab_Atra(n2) + 1
If Tab_Atra(n1) > MAIOR_REPT Then MAIOR_REPT = Tab_Atra(n1)
Else
Tab_Atra(n1) = 1
End If
Atr0(c) = 0
Else
If Tab_Atra(n2) > 0 Then
Tab_Atra(n1) = -1
Else
Tab_Atra(n1) = Tab_Atra(n2) - 1
If Tab_Atra(n1) < MAIOR_ATR Then MAIOR_ATR = Tab_Atra(n1)
End If
End If
Next
Next
end Function
but you do not have to worry about me, I'm just a curious without much ability