antmar904 Posted August 29, 2018 Posted August 29, 2018 Hi I am using Waters AD UDF and I am looking up a users "Name" AD attribute. I can view the array returned but how can I show just the users Name only? Here is the array returned. I would like to show just "Anthony" in a message box.
FrancescoDiMuro Posted August 29, 2018 Posted August 29, 2018 (edited) @antmar904 I imagine that you wrote somewhere an instruction like _ArrayDisplay($arrSomeArray) To display that. So, as you can see from the image, the array is composed by two Rows and two Columns. An array like that is usually called 2D-Array, since it has two dimensions ( Rows and Columns ). To access every single element in your array, you have to specify the Row and the Column ( which are called Indexes ) of that element, remembering that arrays are 0-based, and so, you have to start counting elements from 0, if you have two Rows and two Columns as you do, to show only the Name ( Row 1, Column 1 ), you can do something like ConsoleWrite("Name = " & $arrSomeArray[1][1] & @CRLF) More about Arrays can be found here Edited August 29, 2018 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
badcoder123 Posted August 29, 2018 Posted August 29, 2018 MsgBox(0, "", $ARRAYNAME[1][1]) If you have a list of names just run a for loop on the second [1] For $i = 0 To UBound($ARRAYNAME) - 1 MsgBox(0, "", $ARRAYNAME[$i][1]) Next
antmar904 Posted August 29, 2018 Author Posted August 29, 2018 Yes that is what I was looking for "$ArrayName[1][1]" ! Thank you all!
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