Jump to content
Sign in to follow this  
SaKu

The variable is a number, not a string!

Recommended Posts

SaKu

Hi,

i try to make my first GUI.

I made a new little GUI to explain my problem:

#include <GUIConstants.au3>

$GUI = GUICreate("GUI Output Test", 154, 102, 193, 125)
$input = GUICtrlCreateInput("", 24, 24, 97, 21)
$start = GUICtrlCreateButton("Go!", 24, 56, 97, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $start
            MsgBox(0,"Output",$input)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

If I type anything in the inputfield, the variable will give me the number "3".

Why is this? I want to have the text written in the input-field in my variable!

Please help me :D.

Share this post


Link to post
Share on other sites
Madza91

Use GuiCtrlRead()

#include <GUIConstants.au3>

$GUI = GUICreate("GUI Output Test", 154, 102, 193, 125)

$input = GUICtrlCreateInput("", 24, 24, 97, 21)

$start = GUICtrlCreateButton("Go!", 24, 56, 97, 25, 0)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $start

MsgBox(0,"Output",GUICtrlRead($input))

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
z0mgItsJohn

When You Want To Read A GUI Variable You Must Use

GUICtrlRead ($Variable)oÝ÷ Øw«zÆ(¹'+Ejëh×6#include <GUIConstants.au3>

$GUI = GUICreate("GUI Output Test", 154, 102, 193, 125)
$input = GUICtrlCreateInput("", 24, 24, 97, 21)
$start = GUICtrlCreateButton("Go!", 24, 56, 97, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $start
            MsgBox(0,"Output",GUICtrlRead ($input))
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Hope This Helps :]

~ John


Latest Projects :- New & Improved TCP Chat

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  

×