Jump to content

Retrieve data from Array


 Share

Recommended Posts

Hi.

How is it possible to retrieve data from an array by searching in the array?

I want to retrieve data from col0 by searching in col1.

Func _MisPlacedAD_Accounts()
    _ArrayDisplay($aAllBackupDestination,"AllBackupDestination")
    _ArrayDisplay($aMisPlacedAD_Accounts,"Before delete")
    _ArrayDisplay($aUsersTarget,"UsersTarget")
    Local $aListOfFolders, $sIndex
    for $y = 0 to UBound($aAllBackupDestination) -1
        $aListOfFolders = _FileListToArray($aAllBackupDestination[$y][0],Default,2,False)
        for $z = UBound($aMisPlacedAD_Accounts) -1 to 0 Step -1
            If _ArrayFindAll($aListOfFolders,$aMisPlacedAD_Accounts[$z]) <> -1 Then
                $sIndex = _ArrayFindAll($aUsersTarget,$aMisPlacedAD_Accounts[$z],Default,Default,Default,Default,3)
            ;_ArrayDisplay($aMisPlacedAD_Accounts,"Before delete")
                MsgBox($MB_SYSTEMMODAL, $aMisPlacedAD_Accounts[$z], UBound($sIndex))
                _ArrayDelete($aMisPlacedAD_Accounts,$z)
            ;_ArrayDisplay($aMisPlacedAD_Accounts,"After delete")
            EndIf
        Next
    Next
    _ArrayDisplay($aMisPlacedAD_Accounts,"After delete")
EndFunc

In this case $sIndex is allways 1.

Yours sincerely

Kenneth.

Link to comment
Share on other sites

Questions and answers never get deleted.
It would be great if you could post your solution so it can be useful for other users in the future :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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

×
×
  • Create New...