- Looking through various scripts, one of the main problems is having nested parentheses, within nested parentheses etc.
- When you have too many parentheses/commas/double quotes, and sometimes literal versions of those characters, it can be a problem to read. For literal characters, it can sometimes be good to have a variable e.g. A_Comma/A_DQ (proposed).
- You're using the return value of NumGet (cryptic/verbose), and an initial subtraction (less bad, but still relatively complex for a standard situation).
- Some other workarounds, that aren't great either:
Code: Select all
for vKey, vValue in [1, 2, 3, 4]
vIndex := A_Index-1, NumPut(vValue, &RECT+vIndex*4, "Int")
for vKey, vValue in [1, 2, 3, 4]
NumPut(vValue, &RECT+A_Index*4-4, "Int")
vIndex := -1
for vKey, vValue in [1, 2, 3, 4]
vIndex++, NumPut(vValue, &RECT+vIndex*4, "Int")
- Sometimes, you could get some nice results by using A_Index and A_Index0 together.