Jump to content

The variable is a number, not a string!


SaKu
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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) :)

Link to comment
Share on other sites

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

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...