Sign in to follow this  
Followers 0
iceberg

While Loop

3 posts in this topic

Hi,

#include <GuiConstants.au3>

GuiCreate("Timings", 222, 125,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Ok = GuiCtrlCreateButton("OK", 20, 80, 80, 30)
$Cancel = GuiCtrlCreateButton("Cancel", 120, 80, 80, 30)
$Name = GuiCtrlCreateLabel("Please enter timing details for ", 10, 10, 210, 20)
$Min = GuiCtrlCreateInput("", 10, 40, 20, 20)
$Min1 = GuiCtrlCreateLabel("min", 30, 45, 30, 20)
$Sec = GuiCtrlCreateInput("", 60, 40, 20, 20)
$Sec1 = GuiCtrlCreateLabel("sec", 80, 45, 30, 20)
$Ms = GuiCtrlCreateInput("", 110, 40, 20, 20)
$Ms1 = GuiCtrlCreateLabel("ms", 130, 45, 30, 20)

GuiSetState()

While 1
    
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Cancel
        ExitLoop
    Case $msg = $Ok
        $line = FileReadLine("p.txt")
        $Name2 = GuiCtrlCreateLabel("Please enter timing details for " & $line, 10, 10, 210, 20)
    Case Else
    ;;;
    EndSelect
WEnd
Exit

You need a text file called p.tx in the script directory. It is supposed to contain names of ppl. But the problem I have is that the name doesn't go on to the next one when I hit the OK button. Can someone pls help me out with this?

Thanks.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites



try using fileopen at the top of the script and fileclose on exit and use a handle for the filereadline


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

wow! works very well. thanks.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0