Jump to content

Help on a script


Recommended Posts

Why does this script return 3

#include <GUIConstants.au3>

GUICreate ( "title" , 800 , 600 ) ; will create a dialog box that when displayed is centered
$RESULT = GUICtrlCreateInput("", 110, 40, 100, 20)

$Start = GUICtrlCreateButton ("OK",  60, 70, 50)
GUICtrlSetState(-1,$GUI_DEFBUTTON)
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $MSG = $GUI_EVENT_CLOSE
            Exit

        Case $msg = $Start
            MsgBox(0, '', $RESULT)
    EndSelect
Wend
Link to comment
Share on other sites

  • Moderators

It's showing you the control id, if you move the $start above the $result, you should get $result to return "4" as an example.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Example:

#include <GUIConstants.au3>

GUICreate ( "title" , 800 , 600 ); will create a dialog box that when displayed is centered
$Start = GUICtrlCreateButton ("OK",  60, 70, 50)
$RESULT = GUICtrlCreateInput("", 110, 40, 100, 20)

GUICtrlSetState(-1,$GUI_DEFBUTTON)
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()
       Select
           Case $MSG = $GUI_EVENT_CLOSE
            Exit

           Case $msg = $Start
               MsgBox(0, '', $RESULT)
       EndSelect
Wend

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...