Jump to content

Help with Code


Recommended Posts

First off all thank you for reading my question and sorry for the ugly inglish , i from Brasil

i need to translate this code i made on vb6 to change for Autoit

Function Decoder(ByVal A As String)

Dim Y() As Byte, Z As Long

Y = A

For Z = UBound(Y) - 1 To 0 Step -2

Decoder = Decoder & Chr$(Y(Z) - 1)

Next Z

End Function

I make like this

Func Decode($Str)

$i = int

For $i = 1 To StringLen($Str)

$i = $i & Chr(Asc(StringMid ($Str, $i, 1)) - 8)

Next

EndFunc

But its wrong , I a newbie on AutoIt so hope they dont mad me

Thanks for help and sorry if is not a place for question ,

regards

Link to comment
Share on other sites

Only one more question , I make this based on your code and copy

Ported to AutoIt

Func Decode($Str)
Local $result
Local $Y
Local $Z
$Y = $Str
For $Z = UBound($Y) - 1 To 0 Step -2
$result = $result & Chr($Y($Z) - 1)
Next
Return $result
EndFunc

But dont Works , Thanks a Lot for help

My Code Original on VB6

Function sDecode(ByVal zNull As String)

Dim Y() As Byte, Z As Long

Y = zNull

For Z = UBound(Y) - 1 To 0 Step -2

sDecode = sDecode & Chr$(Y(Z) - 1)

Next Z

End Function

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...