I'm back after a long AHK pause
I guess I lost some skills
Anyway, in my script I call a function and depending on the value, it should output values inside of a MessageBox.
Code: Select all
F1::
A = 212
1 = 966
letter = %A%
digit = %1%
MsgBox, %letter%, %digit%
return
F2::
Click_On_Field("A1")
return
F3::
Click_On_Field_New("A1")
return
Click_On_Field(field)
{
StringTrimLeft, digit, field, 1
StringTrimRight, letter, field, 1
if letter = A
{
letter = 212
}
if letter = B
{
letter = 329
}
if digit = 1
{
digit = 966
}
if digit = 2
{
digit = 855
}
MsgBox, %letter%, %digit%
}
Click_On_Field_New(field)
{
StringTrimLeft, digit, field, 1
StringTrimRight, letter, field, 1
A = 212
1 = 966
MsgBox, %letter%, %digit%
}
The F1 and the F2 script show the correct result.
F3 only shows A and 1, but not the values which are assigned to them.
How to code the F3 script so that it shows 212 and 966 instead of A and 1?
Or is the if block really necessary?
Thanks for any help!