Jump to content

StringInStr


iceberg
 Share

Recommended Posts

hi guys,

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

thanks.

$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

  • Moderators

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: :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)
_ArrayDisplay($FilePath)

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

M23

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:

Spoiler

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...