Sign in to follow this  
Followers 0
chemboy

Need help with Edit box in GUI

5 posts in this topic

#1 ·  Posted (edited)

Hi, im having a problem reading every line in Edit Box.

Here is source:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>

Global $Form1 = GUICreate("Part of AoB generator", 298, 332, 192, 124)
Global $text = GUICtrlCreateEdit("", 0, 0, 297, 257)
Global $Button1 = GUICtrlCreateButton("Generate", 8, 264, 75, 25, $WS_GROUP)
Global $Input1 = GUICtrlCreateInput("", 8, 304, 281, 21)
GUISetState(@SW_SHOW)


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

            
    EndSwitch
WEnd

What i want is read lines from GUI Edit that has "//" in front, and add those lines to Input without a beginning of "//", and do this with every line in Edit.

For example:

"blah blah blah"

// text1

"blah blah blah"

// text2

"blah blah blah"

should give text1 text2

Any suggestions? :/

Edited by chemboy

Share this post


Link to post
Share on other sites



Right now, all you have is a gui, have you attempted anything at all?

All to often you get a string of replies only for the OP to proclaim they "tried all those suggestions first and they didnt work"

If you have not tried anything, first thing you need is GUICtrlRead() <- help file and look at stringsplit()/_stringexplode(), and stringinstr() to get you started.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

looks like _StringExplode(GUICtrlRead($text), "") helps but what i should put as "delimiters" to make string as one line?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Yeah, @CRLF helpped, thank you

Edited by chemboy

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