I need to pass some VB6 code to PHP, but I have a question about what this code does:
Private Function SomarValor(v As String) As Double
Dim x As Byte, resultado As Double
For x = 1 To Len(v)
resultado = resultado + CDbl(Mid(v, x, 1))
Next
SomarValor = resultado
End Function
This function SomarValor()
receives values as 0202827610
, if anyone can help.
I have tried to look for the meaning of these internal functions as CDbl
, Mid
, but I could not understand.