Pain Posted September 9, 2008 Share Posted September 9, 2008 I need some help with this loop. Global $FileList=_FileListToArray(@ScriptDir & "\images\", "*", 1) pic() Func pic() For $top = 50 To 510 Step 230 $count = 1 $side = 20 For $y = 1 To UBound($FileList) - 1 GUICtrlCreatePic(@ScriptDir & "\images\" & $FileList[$count], $side, $top, 0, 0) $count += 1 $side += 320 Next Next EndFunc This one will create 3 rows with pictures next to each other on my gui, all rows use same picture and never ends (it depends on how many pictures there is in the folder). I want it to create 3 pictures on row one and then start on a new row and keep doing like that until all pictures from the folder are used. All these loops are driving me crazy Link to comment Share on other sites More sharing options...
trancexx Posted September 9, 2008 Share Posted September 9, 2008 I need some help with this loop. Global $FileList=_FileListToArray(@ScriptDir & "\images\", "*", 1) pic() Func pic() For $top = 50 To 510 Step 230 $count = 1 $side = 20 For $y = 1 To UBound($FileList) - 1 GUICtrlCreatePic(@ScriptDir & "\images\" & $FileList[$count], $side, $top, 0, 0) $count += 1 $side += 320 Next Next EndFunc This one will create 3 rows with pictures next to each other on my gui, all rows use same picture and never ends (it depends on how many pictures there is in the folder). I want it to create 3 pictures on row one and then start on a new row and keep doing like that until all pictures from the folder are used. All these loops are driving me crazy That's because you are looping too much >_< Try this: Global $FileList=_FileListToArray(@ScriptDir & "\images\", "*", 1) pic() Func pic() Local $top = 50 Local $count = 0 Local $side = 20 For $y = 1 To UBound($FileList) - 1 GUICtrlCreatePic(@ScriptDir & "\images\" & $FileList[$count + 1], $side, $top, 0, 0) $count += 1 $side += 320 If Mod($count, 3) = 0 Then $top += 230 $side = 20 EndIf Next EndFunc ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Pain Posted September 9, 2008 Author Share Posted September 9, 2008 haha thanks alot, I told you the loops where driving me crazy Link to comment Share on other sites More sharing options...
trancexx Posted September 9, 2008 Share Posted September 9, 2008 I'm looking at that code posted earlier and cannot find any sense in that $count part . Lose it ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now