smellyfingers Posted August 24, 2013 Posted August 24, 2013 (edited) Hi all, Have a little problem getting my code to work the way i want, i managed it to count the files that ends with .jpg, but it only shows 1 picture less then there is in the folder, like if i have 10 .jpg's it only shows 9 before it exits, i tried it with a foor loop with step - 1, same thing, and i tried this way like below. #include <File.au3> #include <Array.au3> #Include <GUIConstantsEx.au3> #Include <WindowsConstants.au3> Global $pixtures Global $filecount Call("findthem") Local $i = 0 Do GUICreate('Picit', @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $WS_EX_TOPMOST)) GUICtrlCreatePic(@ScriptDir & "\" & $pixtures[$filecount], 0, 0, @DesktopWidth, @DesktopHeight) GUISetState() Sleep(1000) $i = $i + 1 $filecount = $filecount - 1 Until $i = $pixtures[0] Func findthem() $pixtures = _FileListToArray(@ScriptDir,"*.jpg") If @error = 4 Then MsgBox(0, "", "Hittade inga bilder.") Exit EndIf _ArrayDisplay($pixtures) $filecount = $pixtures[0] EndFunc Nevermind i noticed the error when i posted, , this works Edited August 24, 2013 by smellyfingers
JohnOne Posted August 24, 2013 Posted August 24, 2013 There is no for loop in your code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
FireFox Posted August 24, 2013 Posted August 24, 2013 i tried it with a foor loop with step - 1, same thing, and i tried this way like belowThat's why there is no For loop, he tried but finally posted the Do Loop version.
JohnOne Posted August 24, 2013 Posted August 24, 2013 Until $i > $pixtures[0] AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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