Hey there, I'm writing a script and need to change a string into a variable, been looking for a while and can't find how to do this, it's a bit hard to explain so here's an example
Code: Select all
v1 := "q"
v2 := "e"
v3 := "r"
string := "123"
CurChar := SubStr(string, 1 , 1)
SendInput "{v" CurChar " Down}"
This is not my actual code, the code is too big to put here, this is just an example of what i'm trying to do. CurChar will get the first number of the string and I want to send the correspondent variable, so in the example above, the number is 1 so I would like to send "{" v1 " Down}" which equals {q Down}, if string was "213" it would send "{" v2 " Down}" which equals {e Down}. I know I probably could do it by using if statements but in my actual code I would need way to many if statements(unless there is a way to use them that i'm not sure of), so I was wondering if maybe there's a way to turn the string "v1" into the variable v1 or "v2" into the variable v2