Pause Dialog Box

I am trying to make a dialog box appear in my procedure that stops the execution of code until the user acknowledges the panel. here is my code, but for some reason the error message "Right parentheses expected" pops up every time I click the button1 (the one titled "Yes"):

Function dialog()
NewPanel /W=(50,50,250,140) /N=NextLoop
DrawText 40,30,"Ready for Light Mode?"
Button button1,pos={60,45},size={80,25},title="Yes",proc = kill
PauseForUser nextLoop
End
Function kill()
KillWindow NextLoop
End
A control's action procedure must have a specific format so that Igor knows how to call it. Try this:
Function dialog()
    NewPanel /W=(50,50,250,140) /N=NextLoop
    DrawText 40,30,"Ready for Light Mode?"
    Button button1,pos={60,45},size={80,25},title="Yes",proc = kill
    PauseForUser nextLoop
End
Function kill(ctrlName) : ButtonControl
    String ctrlName
    KillWindow NextLoop
End

The input string giving the control's name *must* be present, and it must have just that. Other controls require different formats; be sure to either use the Control Properties dialog to generate a skeleton for the action procedure, or look it up in the manual.

I've also fixed your indentation :)

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com