Read Write syntax with concatenated Variable Inside Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Read Write syntax with concatenated Variable Inside

19 Feb 2018, 10:41

Hi,
This Code Works:

Code: Select all

Gui, Add, Edit, X50 Y%Y2% H21 W130 vHKeyNS%TrigN2%, % HKeyNS%TrigN2%

IniWrite, % HKeyNS%TrigN2%, Config2.ini, Triggered, HKeyNS%TrigN2%
And This one doesn´t:

Code: Select all

IniRead, HKey%N%S1, Config2.ini, Hotkeys, HKey%N%S1
IniRead, HKey%N%S2, Config2.ini, Hotkeys, HKey%N%S2

Gui, Add, Edit, X10 Y10 H21 W100 vHKey%N%S1, % HKey%N%S1
Gui, Add, Edit, X10 Y40 H21 W100 vHKey%N%S2, % HKey%N%S2

IniWrite, % "HKey" N "S1" , "Config2.ini" , "Hotkeys" , "HKey" N "1"
IniWrite, % HKey%N%S2, Config2.ini, Hotkeys, HKey%N%S2
Someone please tell me the difference :mrgreen:
Tanks and Best Regards!
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: Read Write syntax with concatenated Variable Inside

19 Feb 2018, 11:52

Actually they are both writing wrongly, Its the case that 2 wrongs make a right. The first example only appeared right because it wasn't reading from the ini file :)
Tanks and regards!
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: Read Write syntax with concatenated Variable Inside

19 Feb 2018, 13:47

I got a partial fix. All write codes are correct, but since the read part is inside a sub called by a loop with N+=1 at the end It doesn't +=1, but the write part is on the next sub which in turn happens after the previous sub is completed therefore triggering the initial loop to proceed and add the +=1.
User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Read Write syntax with concatenated Variable Inside

19 Feb 2018, 13:56

It's not clear what you're saying you have fixed and what you still need help with. Can you state what your currently issue and question is now?
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: Read Write syntax with concatenated Variable Inside  Topic is solved

19 Feb 2018, 19:17

Thanks for the reply!
I have it fixed actually.
Sorry for not updating the post.
The problem was with the original loop calling a sub that when finished, both called another sub and continued the loop.
The loop added +=1 to a variable used by the loop, that sub and the next at the loop end.
That offset the 2nd sub called by the first.
Look at my next post and check for the variable TypeN to see my fix!
Thanks and Best Regards!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 268 guests