NextCode Posted June 27, 2012 Posted June 27, 2012 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
NextCode Posted June 27, 2012 Author Posted June 27, 2012 anyone can help with explain the code ? thanks a lot or this
Zedna Posted June 27, 2012 Posted June 27, 2012 (edited) Here is your version with some corrections: Func Decode($Str) Local $result For $i = StringLen($Str) To 1 Step -2 $result = $result & Chr(Asc(StringMid ($Str, $i, 1)) - 8) Next Return $result EndFunc Edited June 27, 2012 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted June 27, 2012 Posted June 27, 2012 Also look here http://www.autoitscript.com/autoit3/docs/intro/lang_functions.htm Resources UDF ResourcesEx UDF AutoIt Forum Search
NextCode Posted June 28, 2012 Author Posted June 28, 2012 thanks a lot man , work perfects for me now because you show me the way , thanks again man
NextCode Posted June 28, 2012 Author Posted June 28, 2012 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
Zedna Posted June 28, 2012 Posted June 28, 2012 (edited) Func Decode($Str) Local $result, $Y, $Z $Y = StringSplit($Str, '') For $Z = UBound($Y) - 1 To 1 Step -2 $result = $result & Chr($Y[$Z] - 1) Next Return $result EndFunc EDIT: fixed () --> [] Edited June 28, 2012 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
NextCode Posted June 28, 2012 Author Posted June 28, 2012 works fine now man , thanks a lot for your time and your help dude , resolved , thanks
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now