Array of GUI Edit controls not submitting Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest5678

Array of GUI Edit controls not submitting

14 Mar 2014, 13:45

I want to make an array of GUI Edit controls and use them.
This code:
loop % grade+1
{
...
Gui, Add, Text, ... vwtf%A_Index%, % "Σημείο " . A_Index
}
doesnt work. Calling

Gui, Submit, NoHide
loop % grade+1
{
MsgBox % "InputArray(" . A_Index . ") = " . wtf%A_Index%
}

returns me a bunch of message boxes indicating each wtf%A_Index% is empty.

I read the following and couldn't still make sense. I have followed the advice on the first colsely but it doesn't work, and I cant really figure the advice from the second
1: http://www.autohotkey.com/board/topic/9 ... -an-array/
2: http://www.autohotkey.com/board/topic/9 ... i-control/
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Array of GUI Edit controls not submitting

14 Mar 2014, 14:12

I don't see a problem with how you are trying to create the pseudo-array. The problem appears to be that you are trying to associate a variable with a text control. The docs don't indicate that a variable can be associated with that type of control.
Ex:

Code: Select all

Loop, 3 {
	Gui, Add, Text, vTextVar%A_Index%, This is some text... %A_Index%
	Gui, Add, Edit, W176 H20 vEditVar%A_Index%
}
Gui, Add, Button, gSub Default, Submit
Gui, Show
return


Sub:
Gui, Submit, Nohide
MsgBox, % "TextVar1: " TextVar1
	. "`nEditVar1: " EditVar1
	. "`nTextVar2: " TextVar2
	. "`nEditVar2: " EditVar2
	. "`nTextVar3: " TextVar3
	. "`nEditVar3: " EditVar3
return

GuiClose:
ExitApp
Last edited by kon on 14 Mar 2014, 17:22, edited 1 time in total.
Guest5678

Re: Array of GUI Edit controls not submitting

14 Mar 2014, 15:10

This is unbelievable. Instead of assigning them on the edit fields I wanted, I assigned them in the text fields that were kind of a title.

Thank you very much!
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Array of GUI Edit controls not submitting  Topic is solved

14 Mar 2014, 17:23

To correct myself, you can associate a variable with a text control. It can be used with, for example, GuiControlGet as the ControlID parameter.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 222 guests