youtuber

Working with words in Edit box?

5 posts in this topic

#1 ·  Posted (edited)

 

$sReadln = StringSplit(GUICtrlRead($Edit1), @CR)

   For $sSearchlst = 1 To $sReadln[0]
   Next

       for $i=0 to 2 step 1
        $sURLsadd = $SGtngURL & $i & "/?s=" & $sReadln[$sSearchlst] ;here how?
        $sSkpsrcs = _InetGetSource($sURLsadd)

 

Edited by youtuber

Share this post


Link to post
Share on other sites



Split the line by a space to get each word

Share this post


Link to post
Share on other sites

Yes I know

the above code is not correct!

$sURLsadd = $SGtngURL & $i & "/?s=" & $sReadln[$sSearchlst]

How will the right?

Share this post


Link to post
Share on other sites
#include <String.au3>
#include <GUIConstants.au3>

Global $sEditText = "Autoit working-with-words-in-edit-box https://www.autoitscript.com/forum/topic/182369-working-with-words-in-edit-box/" & @CRLF & _
                    "Autoit read-edit https://www.autoitscript.com/forum/topic/182358-read-edit/"

Global $aEditLines = StringSplit($sEditText, @CRLF, $STR_NOCOUNT)

For $i = 0 to UBound($aEditLines) - 1
    Local $sWebSource = ""
    Local $aWordsOnLine = StringSplit($aEditLines[$i], ' ', $STR_NOCOUNT)
    If (Not @Error) Then
        ConsoleWrite("Getting source for webpage " & $aWordsOnLine[2] & @CRLF)
        
        $sWebSource = BinaryToString(InetRead($aWordsOnLine[2]))
        Local $hDisplay = GUICreate($aWordsOnLine[1], 600, 500, -1, -1)
        Local $edtSource = GUICtrlCreateEdit($sWebSource, 2, 2, 596, 496)

        GUISetState(@SW_SHOW, $hDisplay)

        Do
        Until (GUIGetMsg() = $GUI_EVENT_CLOSE)
        GUIDelete($hDisplay)
    EndIf
Next

I don't know what kind of data is in your edit but maybe this will help get you going.

1 person likes this

Share this post


Link to post
Share on other sites

Good lucky:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Inet.au3>

#Region ### START Koda GUI section ### Form=
Global $hGUI = GUICreate("Youtuber", 615, 175, 192, 346)
Global $bDo = GUICtrlCreateButton("WORK", 480, 16, 129, 113)
GUICtrlCreateGroup("Word List:", 16, 16, 449, 113)
Global $eWordList = GUICtrlCreateEdit("", 32, 32, 417, 81)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Status = GUICtrlCreateLabel("", 24, 144, 444, 17)
Global $bExit = GUICtrlCreateButton("EXIT", 480, 136, 129, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $WebURL = 'https://www.google.com/search?q='
Global $aWordList, $cURL, $sSource, $sChar = ","
GUICtrlSetData($eWordList, "Word1" & $sChar & "Word2")

While 1
    Switch GUIGetMsg()
        Case -3, $bExit
            Exit
        Case $bDo
            $aWordList = StringSplit(StringStripWS(GUICtrlRead($eWordList), 7), $sChar)
            For $i = 1 To UBound($aWordList) - 1
                $cURL = $WebURL & $aWordList[$i]
                GUICtrlSetData($Status, "Getting source: " & $cURL)
                $sSource = _INetGetSource($cURL)
                GUICtrlSetData($Status, "Ready ")
                ;Do somethink
            Next
    EndSwitch
    Sleep(10)
WEnd

 


Regards,
 

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