Jump to content
Sign in to follow this  

Problem with func - output 0?

Recommended Posts


I have problem with my work...

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
Global $Input1 = GUICtrlCreateInput("", 8, 8, 121, 21)
$Button1 = GUICtrlCreateButton("Button1", 280, 32, 75, 25)
$Edit1 = GUICtrlCreateEdit("", 8, 88, 345, 145)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE

        Case $Button1


Func blanktoplus($aa)
 StringReplace(GuiCtrlRead($aa), " ", "+")
 Global $iReplacements = @extended

Func editb()
    Global $Edit1 = GUICtrlSetData(-1,"The full name is:" & blanktoplus($Input1))



On my form i have: 1x Input, 1x Button, 1x Edit

In input1 i have: Sara Oconnor.

I want after click button to set message in edit1 like this:

The full name is: Sara+Oconnor

Now i have: The full name is: 0


Where is the problem? Thanks!

Share this post

Link to post
Share on other sites

Why not just run your function like this rather than trying to pull your string from @extended?

Func blanktoplus($aa)
 $myString = StringReplace(GuiCtrlRead($aa), " ", "+")
 Return $myString


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...