Jump to content

Search the Community

Showing results for tags 'Driving me nuts!'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi folks. I wont post the whole code (I know, I know - that doesn't help my cause), but only because it reads from internal sharepoint libraries etc and is quite big now. I have a sloppy function that has some problems, as shown below. Basically, I had read a file into a 2D array (looks like this:) c.jpg,Active,1,19/03/2012,15:12 e.jpg,Active,2,16/03/2012,09:51 f.jpg,Active,3,16/03/2012,09:51 a.jpg,Active,4,16/03/2012,09:55 I also read some data from a webpage, into a 2D array which looks identical. In fact, they are identical, except I have changed some of the times on the local file. When I show in a message box: $imageDetArray[$i][4] = 09:55 $imageDetArray[$iIndexi][4] = 09:51 I need to compare them and flag the difference, but when I compare them, using whatever method, it always comes back as matching. I can't figure out why - I guess I have something wrong somewhere, but I can't see the wood for the trees. I guess I would understand more if it always came back as NOT matching.... Any help? $file = FileOpen($checkFile, 0) ;Open downloaded File If $file = -1 Then ;If File didn't open correctly ;Could not open file. Return 0 ;Exit EndIf $fileData = FileRead($file) ;Read file into var FileClose($file) ;Close file $allLines = StringSplit($fileData,@CR) ;_ArrayDisplay($allLines) dim $imageDetArray[Ubound($allLines)][5] ;Create 3D Array with correct size For $i=1 to $allLines[0]-1 ;From array 1 (0 is count) to max $curImageDet = StringSplit($allLines[$i],",",2) ;Split the string by "," ;_ArrayDisplay($curImageDet) $imageDetArray[$i-1][0] = $curImageDet[0] ;Populate the new 3D array with the correct info $imageDetArray[$i-1][1] = $curImageDet[1] $imageDetArray[$i-1][2] = $curImageDet[2] $imageDetArray[$i-1][3] = $curImageDet[3] ;Date (dd/mm/yyyy) $imageDetArray[$i-1][4] = $curImageDet[4] ;Time (hh:mm) Next ;Now compare WEB data to LOCAL data. ;If not on list, download. ;If on list, but different dates, download. Dim $dlImgArray = "" For $i=0 to UBound($webImages)-1 $imageMatch=0 $iIndexi = _ArraySearch($imageDetArray, $webImages[$i][0], 0, 0, 0, 1, 1, 0) If @error Then MsgBox(0, "Not Found", '"' & $webImages[$i][0] & '" was not found on column ' & 0 & '.') Else If $webImages[$i][3] == $imageDetArray[$iIndexi][3]Then msgbox(0,"Same:" & $webImages[$i][0],$webImages[$i][3] & " -- " & $imageDetArray[$iIndexi][3]) EndIf if StringCompare($imageDetArray[$i][4],$imageDetArray[$iIndexi][4],0)=0 Then msgbox(0,"Same:" & $webImages[$i][0],$webImages[$i][4] & " -- " & $imageDetArray[$iIndexi][4]) EndIf Endif Next EXIT I have tried the followig line from above in many methods: if StringCompare($imageDetArray[$i][4],$imageDetArray[$iIndexi][4],0)=0 Then such as: if $imageDetArray[$i][4] == $imageDetArray[$iIndexi][4] Then if $imageDetArray[$i][4] = $imageDetArray[$iIndexi][4] Then but it always shows the message box saying they are the same, even though the contents of the message box clearly show they are different! How can I compare 09:51 and 09:55 to show they are different?
×
×
  • Create New...