iceberg Posted February 11, 2010 Share Posted February 11, 2010 hi guys, can someone kindly enlighten me as to why the StringInStr function doesn't work? thanks. expandcollapse popup$iFiles = FileOpenDialog("Select the XML File/s", @ScriptDir, "Extensible Markup Language (*.xml)", 1 + 4) If @error Then MsgBox(4096, "", "No File(s) chosen") Else $Split = StringSplit($iFiles, "|", 1) For $i = 2 To $Split[0] _ReduceMemory() $iRET = _XMLFileOpen($Split[$i]) ;MsgBox(0, "", $Split[$i]) $Server = StringTrimRight($Split[$i], 4) $sShortMonthName = _DateToMonth(@MON, 1) $Dir = @ScriptDir & "\" & $sShortMonthName & " " & @YEAR & " Patches for " & $Server DirCreate($Dir) $gpname = IniRead($ini, $Server, "FilterGroupName", "FilterGroupName Not Found") If @error Or $iRET <> 1 Then ConsoleWrite("Error: Failed to open XML correctly: $iRET = " & $iRET & "; @error = " & @error & @LF) Exit EndIf $iCnt = _XMLGetNodeCount("/XMLOut/Check[@GroupName='" & $gpname & "']/Detail/UpdateData[@IsInstalled='false']/References/DownloadURL") ConsoleWrite("Debug: $iCnt = " & $iCnt & "; @error = " & @error & "; @extended = " & @extended & @LF) $aDownloadURLs = _XmlGetValue("/XMLOut/Check[@GroupName='" & $gpname & "']/Detail/UpdateData[@IsInstalled='false']/References/DownloadURL") ConsoleWrite("Debug: @error = " & @error & "; @extended = " & @extended & @LF) If IsArray($aDownloadURLs) Then _ArrayDelete($aDownloadURLs, 0) ;_ArrayDisplay($aDownloadURLs, "Download URLs") $count = UBound($aDownloadURLs) $j = 0 Do $exclude = IniReadSection($ini, $Server & "-Filters") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else $FilePath = _PathSplit($aDownloadURLs[$j], $szDrive, $szDir, $szFName, $szExt) For $e = 1 To $exclude[0][0] If StringInStr($FilePath, $exclude[$e][1]) Then MsgBox(0, "Found", "Matched " & $exclude[$e][1]) Next EndIf $j = $j + 1 Until $j = $count EndIf Next EndIf mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 11, 2010 Moderators Share Posted February 11, 2010 iceberg,$FilePath = _PathSplit($aDownloadURLs[$j], $szDrive, $szDir, $szFName, $szExt)What do you think is in $FilePath? Have you checked? Have you looked at what the Help file says you will get?Perhaps if you run this snippet: #include <Array.au3> #Include <File.au3> Global $szDrive, $szDir, $szFName, $szExt $FilePath = _PathSplit("C:\fred\fred.frd", $szDrive, $szDir, $szFName, $szExt) ConsoleWrite("-" & $FilePath & "-" & @CRLF) _ArrayDisplay($FilePath)StringInStr works fine - if it has strings to work with! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
iceberg Posted February 12, 2010 Author Share Posted February 12, 2010 (edited) thanks once again Melba23! your last line made me really think very hard. i have managed to resolve the problem. Edited February 12, 2010 by iceberg mouse not found....scroll any mouse to continue. 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