jben Posted April 18, 2008 Share Posted April 18, 2008 Hey everyone. Just a quick one. I'm wondering if anyone knows how I can add more items to the code below. I have tried to use "&" but its not working Thanks $aZipList = _ZipList2Array($szZipFile) for $x =0 to UBound($aZipList)-1 If StringLower(StringRight($aZipList[$x][1],4)) = ".png"&".gif" Then;THIS LINE IS THE PROBLEM ConsoleWrite("Extracting:"&$aZipList[$x][1]) $vResult = _ZipUnZipItem($szZipFile,$aZipList[$x][1],$szDestDir) ConsoleWrite(" -- "&_ZipFormatMessage($ZR_RECENT)&@lf) Link to comment Share on other sites More sharing options...
Valuater Posted April 18, 2008 Share Posted April 18, 2008 If StringLower(StringRight($aZipList[$x][1],4)) = ".png" Or StringLower(StringRight($aZipList[$x][1],4)) = ".gif" Then;THIS LINE IS THE PROBLEM 8) Link to comment Share on other sites More sharing options...
jben Posted April 18, 2008 Author Share Posted April 18, 2008 (edited) Thanks... One question thats now come to my mind. What if i wanted to include 4 different file types, would i just add more with "OR" Update -------- The code sems to copy the files, but now returns an error C:\Program Files (x86)\AutoIt3\Include\AVIConstants.au3 (11) : ==> Can not redeclare a constant.: Global Const $ACS_CENTER = 1 Global Const ^ ERROR Edited April 18, 2008 by jben Link to comment Share on other sites More sharing options...
jben Posted April 18, 2008 Author Share Posted April 18, 2008 (edited) It seems like the code is causing an issue, for some reason??. here is the code, thought it might help to post it here. $szZipFile = $targetDir &"DATA_CHILD.zip";this is the zip file to extract $szDestDir = "C:\OUTPUT";this is the destination to extract the zip files $aZipList = _ZipList2Array($szZipFile) for $x =0 to UBound($aZipList)-1 If StringLower(StringRight($aZipList[$x][1],4)) = ".png" Then;this code extracts the files ConsoleWrite("Extracting:"&$aZipList[$x][1]) $vResult = _ZipUnZipItem($szZipFile,$aZipList[$x][1],$szDestDir) ConsoleWrite(" -- "&_ZipFormatMessage($ZR_RECENT)&@lf) EndIf Next Edited April 18, 2008 by jben Link to comment Share on other sites More sharing options...
Valuater Posted April 19, 2008 Share Posted April 19, 2008 Thanks... One question thats now come to my mind. What if i wanted to include 4 different file types, would i just add more with "OR" Yes, however there is no need to continue checking strinstr-right 4 just do it this way for $x =0 to UBound($aZipList)-1 $pic_type = StringLower(StringRight($aZipList[$x][1],4)) If $pic_type = ".png" Or $pic_type = ".gif" Or $pic_type = ".tif" Or $pic_type = ".bmp" Then;THIS LINE IS THE PROBLEM Update -------- The code sems to copy the files, but now returns an error C:\Program Files (x86)\AutoIt3\Include\AVIConstants.au3 (11) : ==> Can not redeclare a constant.: Global Const $ACS_CENTER = 1 Global Const ^ ERROR there is not enough code here to be sure, however it appears to be a duplicated globilized construct within two different "includes". just look inside the "includes" for this Global Contruct. most likely you can just remove it from the AVIConstants.au3 open the include, just place a semicolon here, and save it ; Global Const $ACS_CENTER = 1 ^ right there 8) 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