Sign in to follow this  
Followers 0
walle

Array, adding line by line

4 posts in this topic

#1 ·  Posted (edited)

Looking for a better way of doing this, instead of adding

string by string, like with the top10 array.

Func TOP10()
    _GUICtrlListBox_ResetContent($LISTBOX1)
$SOURCE = _INETGETSOURCE("http://www.swedvdr.org/browse.php?sort=7&type=desc")
$Top10 = _StringBetween($SOURCE,"'><b>","</b></font></a><br>")
For $I = 0 To $Top10 [0]
Next
_GUICtrlListBox_AddString($LISTBOX1, "________TOP10_______")
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [0])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [1])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [2])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [3])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [4])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [5])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [6])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [7])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [8])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [9])
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [10])
EndFunc
Edited by walle

Share this post


Link to post
Share on other sites



You've already got a For/Next loop there, use it!

_GUICtrlListBox_AddString($LISTBOX1, "________TOP10_______")

For $I = 0 To $Top10 [0]

_GUICtrlListBox_AddString($LISTBOX1, $Top10 [$I])

Next

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Func TOP10()
    _GUICtrlListBox_ResetContent($LISTBOX1)
$SOURCE = _INETGETSOURCE("http://www.swedvdr.org/browse.php?sort=7&type=desc")
$Top10 = _StringBetween($SOURCE,"'><b>","</b></font></a><br>")
_GUICtrlListBox_AddString($LISTBOX1, "________TOP10_______")
For $I = 1 To UBound($Top10) - 1
_GUICtrlListBox_AddString($LISTBOX1, $Top10 [$I])
Next
EndFunc

Something like that. You weren't too far off.

EDIT: My bad, was beaten to it :)

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Thanks for quick replays!

Works, tried _GUICtrlListBox_AddString($LISTBOX1, $Top10 [$I]) once

before, only added one string. For $I = 1 To UBound($Top10) 1 did the

trick.

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