Jump to content
Sign in to follow this  


Recommended Posts


hi guys,

can someone kindly enlighten me as to why the StringInStr function doesn't work?


$iFiles = FileOpenDialog("Select the XML File/s", @ScriptDir, "Extensible Markup Language (*.xml)", 1 + 4)

If @error Then
    MsgBox(4096, "", "No File(s) chosen")
    $Split = StringSplit($iFiles, "|", 1)
    For $i = 2 To $Split[0]
        $iRET = _XMLFileOpen($Split[$i])
        ;MsgBox(0, "", $Split[$i])
        $Server = StringTrimRight($Split[$i], 4)

        $sShortMonthName = _DateToMonth(@MON, 1)
        $Dir = @ScriptDir & "\" & $sShortMonthName & " " & @YEAR & " Patches for " & $Server

        $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)
        $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
                $exclude = IniReadSection($ini, $Server & "-Filters")
                If @error Then
                    MsgBox(4096, "", "Error occurred, probably no INI file.")
                    $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])
                $j = $j + 1
            Until $j = $count

mouse not found....scroll any mouse to continue.

Share this post

Link to post
Share on other sites


$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: :D

#include <Array.au3>
#Include <File.au3>

Global $szDrive, $szDir, $szFName, $szExt

$FilePath = _PathSplit("C:\fred\fred.frd", $szDrive, $szDir, $szFName, $szExt)
ConsoleWrite("-" & $FilePath & "-" & @CRLF)

StringInStr works fine - if it has strings to work with! :huggles:


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

thanks once again Melba23!

your last line made me really think very hard.

i have managed to resolve the problem.


Edited by iceberg

mouse not found....scroll any mouse to continue.

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