Sign in to follow this  
Followers 0
kevinward13

Inputbox not getting input

6 posts in this topic

After my first script in which water helped a great deal...thanks water! I decided to try and expand my knowledge and write a script that will further enahnce the one previous. this time i am attempting to make it look pretty. so here goes.

Global $uName, $uPass, $uServer

Getlogin()
;RemedyLogin()


Func GetLogin()
    Local $IUserName, $msg, $Sub_Button, $No_Sub    
        
    GUICreate("Enter Username...", 250, 80)
    GUISetState(@SW_SHOW)
    $IUserName = GUICtrlCreateInput("", 70, 10, 170, 20)
    $Sub_Button = GUICtrlCreateButton("Submit", 55, 50, 100)
    $No_Sub = GUICtrlCreateButton("Cancel", 190, 50, 50)
    GUICtrlCreateLabel("Username:", 10, 10)
    GUISetState()
    
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Sub_Button
                $uName = $IUserName
                MsgBox(0, 'Testing', $uName)
            Case $msg = $No_Sub
                ExitLoop
        EndSelect
    WEnd

EndFunc

Works sort of. I get the nice pop up window and the buttons work, however I have been trying to get the local variable in the function to be set to a global one so i can use it in another function.

Right now it returns "3"

What am i doin wrong?

Share this post


Link to post
Share on other sites



you need to GuiCtrlRead your $IUserName when the submit button is clicked, that will "read" the contents of the input :huh2:


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

You read out the control id not its value!

Try this line instead:

$uName = GUICtrlRead($IUserName)

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

you need to GuiCtrlRead your $IUserName when the submit button is clicked, that will "read" the contents of the input ;)

yea i knew that :huh2:

Share this post


Link to post
Share on other sites

Feel proud my Graduates! U passed the exam with flying colors :huh2:

Share this post


Link to post
Share on other sites

oh and thanks!

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  
Followers 0