Hello
After much reading, I found the help part of the functions
As far as thinbasic is concerned, I think I can
But I did not find goto or gosub, I know there is a public hatred for these jump commands
But I'm not too smart to ride the things I want without it
For l = LxO To 1 Step -1
If ResulFolm(l, 1) <> 2 Then
For C2 = c2x To Cfco
v = Comand(C2)
For c = Cid To Cfd
dd = Array_valor(l, c)
Call Convert_tipo(dd, Tipo, v)
If v = dd Then GoTo pula_Ev
Next
ResulFolm(l, 1) = 2 'false
GoTo pula_Ef
pula_Ev:
Next
ResulFolm(l, 1) = 1 'True
End If
pula_Ef:
Next
Function Forma_Lista(lista As Variant, ByVal linha As Long) As Variant
Dim C As Long, tem As Boolean, Llt As Long, l As Long
Llt = UBound(lista, 1)
l = 20
Le_Lista:
cis = Split(lista(linha, 1), ";")
tem = False
For C = 0 To UBound(cis)
testnovo:
If IsNumeric(cis(C)) Then
D = Split(lista(cis(C), 1), ";")
If UBound(D) > 0 Then
' e = cis(C)
cis(C) = lista(cis(C), 1)
D = Split(cis(C), ";")
' lista(e, 1) = ""
If UBound(D) > 0 Then tem = True
Else
cis(C) = D(0)
GoTo testnovo
End If
End If
' Cells(l, 20).Value2 = Join(cis, ";")
l = l + 1
If l > 1000 Then End
' Debug.Print Join(cis, ";")
Next
If tem Then linha = Llt: lista(linha, 1) = Join(cis, ";"): GoTo Le_Lista
Forma_Lista = cis
End Function
The functions posted earlier are to transform combinations into decimal and decimal in combination
1,2,25> 25165825
25165825>1,2,25
So comparisons can be made without the loops on top of each value
I also have to value csn
Function cobinaçãoCSN(combinação As Range, valor_max)
If IsArray(combinação) Then
arr = combinação.Value2
c = UBound(arr, 2)
If UBound(arr, 1) > 1 Then cobinaçãoCSN = "apenas uma linha por combinação": Exit Function
Dim i As Long
Dim b As Double, dd As Double
b = 1
For i = 0 To c - 1
b = b * (valor_max - i) / (c - i)
Next
dd = b
c3 = c
For cc = 1 To c3
n = valor_max - arr(1, cc)
b = 1
For i = 0 To c - 1
b = b * (n - i) / (c - i)
Next
c = c - 1
dd = dd - b
Next
cobinaçãoCSN = dd
End If
End Function
to use in excel
= cobinaçãoCSN(G13: I13; 100)
= cobinaçãoCSN(combination range 1 line only, maximum value)
I also have for the csn to combine, despite having to put error handling
Can you tell me if there is any function that allows variables to be used by the string?
varAux="Variable" & "name"
stringVAR(varAux)=10
var2=stringVAR(varAux)
Eduardo
Bookmarks