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




