Hi jus messing round with some simple encryption here...
main problem is my return value does not get returned to the main process...
--------------------------------------------------------------------------
[CODE=vb] Public Function SimpleCrypt( _
ByVal myVal As String) As String
Dim strTempChar As String, i As Integer
Dim tempval As String
Dim a As Integer
a = len(myVal)
For i = 1 To Len(myVal)
strTempChar = asc(mid(myVal, i, 1))
strTempChar = CInt(strTempCha r) '---
strTempChar = strTempChar * 5
strTempChar = strTempChar / 10
strTempChar = strTempChar - 50
strTempChar = strTempChar + 25
tempval = CStr(tempval) + strTempChar '---
Next i
myVal = tempval
Return myVal
End Function[/CODE]----------------------------------------------------------------------
My button-------------------------------------
Dim MyVal As String
MyVal = TextBox1.Text
SimpleCrypt(MyV al)
TextBox2.Text = MyVal
-------------------------------------------
i put "a" in the textbox1. it goes thru my function and myval get the value 63.xxxxxxx
but it neva returns it. am i missing something?
textbox2 always gets the same value as textbox1 before the function was called.
Cheers
main problem is my return value does not get returned to the main process...
--------------------------------------------------------------------------
[CODE=vb] Public Function SimpleCrypt( _
ByVal myVal As String) As String
Dim strTempChar As String, i As Integer
Dim tempval As String
Dim a As Integer
a = len(myVal)
For i = 1 To Len(myVal)
strTempChar = asc(mid(myVal, i, 1))
strTempChar = CInt(strTempCha r) '---
strTempChar = strTempChar * 5
strTempChar = strTempChar / 10
strTempChar = strTempChar - 50
strTempChar = strTempChar + 25
tempval = CStr(tempval) + strTempChar '---
Next i
myVal = tempval
Return myVal
End Function[/CODE]----------------------------------------------------------------------
My button-------------------------------------
Dim MyVal As String
MyVal = TextBox1.Text
SimpleCrypt(MyV al)
TextBox2.Text = MyVal
-------------------------------------------
i put "a" in the textbox1. it goes thru my function and myval get the value 63.xxxxxxx
but it neva returns it. am i missing something?
textbox2 always gets the same value as textbox1 before the function was called.
Cheers
Comment