Jump to content

Recommended Posts

Posted (edited)

Local $MyVariable = InputBox('Question', 'What is your name?')
MsgBox(64, 'Message', 'Your name is ' & $MyVariable & '.')

Edit: The InputBox() has a Cancel button and you might want to (e.g.) exit your script if the user clicks it. Here's how:

Local $MyVariable = InputBox('Question', 'What is your name?')
If @Error Then Exit
MsgBox(64, 'Message', 'Your name is ' & $MyVariable & '.')
Edited by LxP
Posted

if you want to do it using a gui try this 1:

#include<guiconstants.au3>; include this to make a gui
$main = guicreate ("Main window", 200, 100); create the main window of the gui
$input = guictrlcreateinput ("", 10, 10, 180); here is your inputfield
$button = guictrlcreatebutton ("Action", 10, 40, 180); the button for an interaction
guisetstate(); to let someone see the gui

while 1; for infinte loop
$msg = guigetmsg(); to find out if the something happens in the gui, e.g. button pressed
select; mutiple options
case $msg = $GUI_EVENT_CLOSE; to detect if someone hits the X to close the window
exit; then exit the script
case $msg = $button; someone pushed the button
msgbox (0, "Message", "You typed " & guictrlread($input)); messagebox - title:Message - text: You typed & whatever is in the input
endselect; for ending the select
wend; for ending the whileloop

the script can only be exited with the X-button

longer version as LxP did but i like that 1 more

ok it's not that easy

good luck with your script

btw what do you need that for?

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
  • Recently Browsing   0 members

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