Moderators SmOke_N Posted July 5, 2005 Moderators Posted July 5, 2005 Hey all, I thought I saw a few days ago a similar post, but I can't seem to find it. I'm trying to get a variable to translate to a different value. $var = "1234567890" Trying to give each number a specific value like this. 1 = "h" 2 = "I" 3 = "3" 4 = "R" 5 = "J" 6 = "6" 7 = "b" 8 = "Z" 9 = "9" 0 = "00" So if you got $var = "1234567890" and translated it to = "hI3RJ6bZ900" or if you had $var = 22315994 it would be "II3hJ99R". I'm sure it's using the arrays, but my homework is lacking today (besides I suck at them). Any help is appreciated. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Developers Jos Posted July 5, 2005 Developers Posted July 5, 2005 Dim $Codes[10] $Codes[0] = "00" $Codes[1] = "h" $Codes[2] = "i" $Codes[3] = "3" $Codes[4] = "R" $Codes[5] = "j" $Codes[6] = "6" $Codes[7] = "b" $Codes[8] = "Z" $Codes[9] = "9" ; $var = "1234567890" $Out_Var = "" For $x = 1 to StringLen($var) $i = number(StringMid($var,$x,1)) $Out_Var = $Out_Var & $Codes[$i] Next MsgBox(0,'test',$Out_Var) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators SmOke_N Posted July 5, 2005 Author Moderators Posted July 5, 2005 (edited) Thanks and that was quick: Ask for help get the "answer". I'll study this so that I can understand exactly what you did!! Thanks again JdeB Edit: Wish I could spell!! Edited July 5, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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