Jump to content


Photo

GuiControl does not update in a loop? (SOLVED)


  • Please log in to reply
3 replies to this topic

#1 capbat

capbat
  • Members
  • 159 posts

Posted 11 August 2012 - 04:04 PM

Hi All

I have searched the forum and read the documentation but I still can not see what is wrong with this script.
As is, the script works ok but only modify the Text control on the first pass of the loop??? Why?

Here is my code.

Gui, Add, Text, x30 y20 w130 h20 , URLIDNOCTRL
Gui, Show, x900 y200 h420 w470, Test

Loop	;counts the number of item in file.
{
    FileReadLine, line, Test.dat, %A_Index%
	counter:=A_Index
    if ErrorLevel
        break
}

Loop ,%counter%			; Modify the Text Control
{
	FileReadLine, line, Test.dat, %A_Index%
	IDNO:=Line
	GuiControl, , URLIDNOCTRL, %IDNO%
}			

I ran it with debugger and I can see that the IDNO var gets updated with the Line var at each pass but the
GuiControl, , URLIDNOCTRL, %IDNO%
line does not seem to update the gui after the first pass.

The Test.dat file contains the following.

EX244B
EX206S
EX085X
EX245B


Your help is always greatly appreciated.

Tks Bat

#2 Guests

  • Guests

Posted 11 August 2012 - 04:14 PM

remove command add v Gui, Add, Text, x30 y20 w130 h20 vURLIDNOCTRL ?

#3 Guests

  • Guests

Posted 11 August 2012 - 04:14 PM

that is supposed to read "remove comma and ..."

#4 capbat

capbat
  • Members
  • 159 posts

Posted 11 August 2012 - 04:30 PM

Thanks very much 'Guest'
Solved in 10 minutes...
This is a great place.... :D :D :D