AutoIt Variable Question

03/08/2008 21:57 hok30#1
Another stupid AutoIt Question...
Ok So... I have lets say I have an inputbox called $input and it works fine. So lets say the input box says
Code:
What is your name?
And so the user types
Code:
Bob
I am wondering how to have a message box come up and say
Code:
Hello Bob!
If possible I need whole code. Whoever answers my question gets thanks :D
03/08/2008 22:03 Coksnuss#2
Quote:
GUICtrlRead ( controlID [, advanced] )
.
03/08/2008 22:06 hok30#3
I don't get it lol. I just started programming autoit so I have no clue what you are talking about...
03/08/2008 22:25 Hiyoal#4
Quote:
Originally Posted by Coksnuss View Post
.
Thats not right, he isnt using GUI Controls.

Ok. You would set it out like this:

Code:
"Variable with the dollar sign"=inputbox("HI!","Hello...Who are you?")

If @error=1 Then
Exit
EndIf

MsgBox(0,"","Your name is " & )
Hope that helps you, what it does is it displays the string "Your name is " and then also gets the variable and adds it to the string using the "&" symbol.

You can also use ""[String]" & @CRLF & "[String2]" in your messagebox parameter #3 which will make a new line so that the sample code would display as this:

Code:
         Title

[String]         ;@CRLF enters down a line and then writes "String2"
[String]

         |OK|
Hope that is in some depth,

Hiyoal :D
03/08/2008 22:28 hok30#5
lol I knew you were going to answer... The Code Tags cut off some stuff I am just wondering what they cut off exactly... Can you post it out of the code tags.... (For the first one)


EDIT: I tried it like this and I got an error 0.0
$input=inputbox("HI!","Hello...Who are you?")

If @error=1 Then
Exit
EndIf

MsgBox(0,"","Your name is " & )
03/08/2008 22:31 Hiyoal#6
sure...sry bout that:

$input=inputbox("HI!","Hello...Who are you?")

If @error=1 Then
Exit
EndIf

MsgBox(0,"","Your name is " & $input)

There you go :p
03/08/2008 22:35 hok30#7
:D Now I can give you TWO thanks :D

One more thing. How do I make it so when I press a button... xxx happens... so like
OnButtonClick

Or somthing
03/08/2008 22:40 Hiyoal#8
:D

Glad I helped out, If you have any more questions you can always PM me ;)

I taught myself quite a lot of AutoIt in a year, and I think I would be one of the people on this section who is "Pro" with the language.

Hiyoal :p
03/08/2008 22:44 hok30#9
I agree you are Pr0 lol... (Another Thanks... :D)
One more thing. How do I make it so when I press a button... xxx happens... so like
OnButtonClick

Or somthing
03/08/2008 22:57 UPSman2#10
Quote:
Originally Posted by hok30 View Post
I agree you are Pr0 lol... (Another Thanks... :D)
One more thing. How do I make it so when I press a button... xxx happens... so like
OnButtonClick

Or somthing
in a gui?

if so... it'd look somthing like this



#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$Button1 = GUICtrlCreateButton("Button1", 80, 110, 75, 25, 0)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
(put stuff here)
EndSwitch
WEnd
03/08/2008 22:58 hok30#11
... Well are buttons GUI??? lol yes in a gui