gregster wrote:Noo0B wrote:I suppose AHK reads all the code first and uses values for the first gui at the second gui part of the sub, and "if" is only for execute.
Not really sure what this means, but doesn't sound accurate. Obviously
variables can be changed during runtime and AHK will use the up-to-date variable contents during the flow of code execution.
True on that.
The variable and the ifs needed quotes to get the if's conditions to work, otherwise they would just run through.
So I guess it matches my previous experience with literal strings.
I went back and forth between 2 and 3 subs for guis for a while.
2 being for hk's 1 and 2 "_1" suffixes and the next to the "_2" suffix and its gui tab, that sufficed.
3 subs was getting a "_2" separate gui sub for each hotkey, but it helped me solidify the need for the quotes.
I'm not sure if I would be able to go back to a single sub for the two guis though, I sure its possible, but guess i'm going to go back at it and try joining them later.
Right now I'm at the read/write gui, wich goes with an inner sub that sets a double var deref loop for read and writes:
Code: Select all
LCAdd:
L:= 1
C:= 1
Loop {
IniRead, %Swap%RadioL%L%C%C%Hotkey%Hk%, Config.ini, %Swap%Position, %Swap%RadioL%L%C%C%Hotkey%Hk%
C+= 1
If (C > 12) {
If (L = 5)
Break
C:= 1
L+= 1
}
}
C:= 1
L:= 1
Return
;and
LCCoordAdd:
L:= 1
C:= 1
Loop {
IniWrite, % %Swap%RadioL%L%C%C%Hotkey%Hk%, Config.ini, %Swap%Position, %Swap%RadioL%L%C%C%Hotkey%Hk%
If (%Swap%RadioL%L%C%C%Hotkey%Hk% = 1) {
%Swap%Hotkey%Hk%_X:= 1240 + (C*53)
%Swap%Hotkey%Hk%_Y:= 560 + (L*54)
}
C+= 1
If (C > 12) {
If (L = 5)
Break
C:= 1
L+= 1
}
}
C:= 1
L:= 1
Return