Jump to content
Sign in to follow this  
Arclite86

Do..Untill

Recommended Posts

Geir1983

Do you want to call the function $i times, or do you want to call it until it returns the same as $i?

Share this post


Link to post
Share on other sites
Arclite86

Do you want to call the function $i times, or do you want to call it until it returns the same as $i?

I want to call the function $i times,

 

Show func scanner

this is the function:

Func scanner()

    $link = GUICtrlRead($list1)

$oIe  =_IECreate("https://twitter.com/"&$link,0,0,1,1)
_IENavigate($oIe, "https://twitter.com/" &$link)

$oIe = _IEAttach("Twitter")

If @error = $_IEStatus_NoMatch Then
    ConsoleWrite("tab niet gevonden" & @CRLF)
    Exit
EndIf

$oLinks = _IELinkGetCollection($oIe)

If @error = $_IEStatus_Success Then
    $linkCnt = @extended
    ConsoleWrite("Link count = " & $linkCnt & @CRLF)

    For $oLink In $oLinks
        If $oLink.className = 'js-nav' Then
            If $oLink.getAttribute('data-nav') = 'followers' Then
                                            $4er =  _GUICtrlListBox_GetCurSel($List2)
 _GUICtrlListBox_ReplaceString($List2, $4er, ""& $oLink.innerText)
                ConsoleWrite('Followers = ' & $oLink.innerText & @CRLF)


    ;_GUICtrlListBox_AddString ($list2,""& $oLink.innerText)
            ;   $4GG =  _GUICtrlListBox_GetCurSel($List2)
;_GUICtrlListBox_ReplaceString($List2, $4GG, ""& $oLink.innerText)


$text = _GUICtrlListBox_GetCurSel($List2)
_GUICtrlListBox_ReplaceString($List2,$text,""& $oLink.innerText)

            EndIf
        EndIf
    Next
EndIf




$oLinks2 = _IELinkGetCollection($oIe)
    For $oLink2 In $oLinks2
        If $oLink2.className = 'js-nav' Then
            If $oLink2.getAttribute('data-nav') = 'following' Then
                ConsoleWrite('following = ' & $oLink2.innerText & @CRLF)
                                            $4er =  _GUICtrlListBox_GetCurSel($List3)

;_GUICtrlListBox_AddString ($list3,""& $oLink2.innerText)
;                           $4er =  _GUICtrlListBox_GetCurSel($List3)
 ;_GUICtrlListBox_ReplaceString($List3, $4er, ""& $oLink2.innerText)


$text =  _GUICtrlListBox_GetCurSel($List3)
_GUICtrlListBox_ReplaceString($List3,$text,""& $oLink2.innerText)

            EndIf
        EndIf
    Next



            $iIndex += 1
            If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List1, $iIndex)

            If $iIndex = _GUICtrlListBox_GetCount($List2) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List2, $iIndex)

                        If $iIndex = _GUICtrlListBox_GetCount($List3) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List3, $iIndex)


            If $iIndex = _GUICtrlListBox_GetCount($List4) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List4, $iIndex)




            If $iIndex = _GUICtrlListBox_GetCount($List5) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List5, $iIndex)
_IEQuit ($oIe)
EndFunc

Share this post


Link to post
Share on other sites
Arclite86

does somebody know how to read a few line from a text file and than sum them up

something like line1 + line2 + line3 etc.. =..

Share this post


Link to post
Share on other sites
Geir1983

you can add strings with &...

Share this post


Link to post
Share on other sites
Arclite86

no sorry that not what i meant

in the list a have a few lines with numbers, like:  line1=787 line2=388 line3= 482  but  how sum them up?

Share this post


Link to post
Share on other sites
Arclite86

The '+' should work

but how can i write it as a good function

do I have to use: line1+line2+line3 etc, i have about 40 lines and the list grows daily 

I know i have to do something with

Local $i = _GUICtrlListBox_GetCount($list1)
GUICtrlSetData($Edit15,$i)

to read the lines in total of a list, but thats all,..

Share this post


Link to post
Share on other sites
mikell

Assuming the numbers are in the lines of the listbox

Local $count = _GUICtrlListBox_GetCount($list1)
Local $item, $total = 0
For $index = 0 to $count-1
   $item = _GUICtrlListBox_GetText($list1, $index)
   $total += Number($item)
Next
Msgbox(0,"", $total)

Edit

You really should read and re-read the helpfile...

Edited by mikell

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.