Sign in to follow this  
Followers 0
Syed23

Finding difficulty on using _Arraydisplay function

14 posts in this topic

hi ,

I have a function which will check the proerties of the user from AD and i am passing into the array values. But i couldn't display it in proper way by using _ArrayDisplay function. I am just digging myseld for 5 hours to find the issue but i am not. Can some one help me.

For example i have pasted the code below.


Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Syed23,

You cannot display an array by cell number:

Global $array = _ArrayDisplay($array_user[0], "Active Directory Functions -  Complete Properties for user '" & $inp1 & "'")

You can do this by cell number:

If IsArray($array_user) Then MsgBox(0, "", $array_user[0])

I'm trying to understand what you want from your code ... perhaps this is better:

_ArrayDisplay($array_user, "Active Directory Functions -  Complete Properties for user '" & $inp1 & "'")
If $array_user[0] = 1 Then
    _FileWriteLog($logpath, "INFO>>" & "User Properties Infor>>  " & "User AD properties have been showed")
EndIf

You have numerous problems with the script. It's a good idea to declare Global variables at top of script under includes.

I have no idea where $array_user comes from. You need to declare it first.

Global $array_user[11]
Edited by ripdad

Make yourself sheep and the wolves will eat you - Benjamin Franklin

Share this post


Link to post
Share on other sites

Hi ripdad,

i tried this below you mentioend code. But still it did not workout for me.Then only i posted my querry to you guys... My actual probelm is i am getting the user property from AD and i am passing it in to the Array variable. When i try to diplay all the array values tiogether in a sing Arraydisplay method it is not working. Hope i am making sense now? do u understand what i seeking from you?

[ autoIt ] ( Popup )_ArrayDisplay($array_user, "Active Directory Functions - Complete Properties for user '" & $inp1 & "'")If $array_user[0] = 1 Then _FileWriteLog($logpath, "INFO>>" & "User Properties Infor>> " & "User AD properties have been showed")EndIf


Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites

Syed23,

Are you getting any error messages?

Like ---> Error: Array variable has incorrect number of subscripts


Make yourself sheep and the wolves will eat you - Benjamin Franklin

Share this post


Link to post
Share on other sites

Ripdad,

I am not getting such error message. But it shows me the empty array list instead of values... :graduated:


Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites

Hi JamesBrooks,

If you see in the top most of the code you can see that i have declared it. still it did not work for me. orelse you want me to change the poistion of the decalration?

Global $adObj_displayName,$Form1,$Radio1,$Radio2,$Radio3,$Button1,$Button2,$Label2,$nMsg,$Input1,$Input2,$state,$array_user[12],$userName


Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Syed23,

This ...

Global $adObj_displayName,$Form1,$Radio1,$Radio2,$Radio3,$Button1,$Button2,

$Label2,$nMsg,$Input1,$Input2,$state,$array_user[12],$userName

is not in the script you provided in your first post. Are we missing some other parts? Edited by ripdad

Make yourself sheep and the wolves will eat you - Benjamin Franklin

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Syed23,

This ...

is not in the script you provided in your first post. Are we missing some other parts?

sorry for that and you haven't missed anything :graduated: . i used that variable only for getting the user name detail... i mean i will get the user detail in InptuBox 1 and i will pass it into this variable.

Edited by Syed23

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites

Syed23, play with this some ...

#include <array.au3>

Global $array_user[12]
$array_user[0] = 11

$array_user[1] = "user01"
$array_user[2] = "company"
$array_user[3] = "department"
$array_user[4] = "displayName"

_ArrayDisplay($array_user)

Make yourself sheep and the wolves will eat you - Benjamin Franklin

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Syed23, play with this some ...

#include <array.au3>

Global $array_user[12]
$array_user[0] = 11

$array_user[1] = "user01"
$array_user[2] = "company"
$array_user[3] = "department"
$array_user[4] = "displayName"

_ArrayDisplay($array_user)

Hi ,

with the reference of above code i tried everything but still the result same. i followed the below steps. It did not work for me.

Scenario 1: I declared array and i passed the AD propertied in the array variable. Then i tried to display all the collective arrays in _ArrayDisplay it did not work.

Scenario 2: If i followed the same code whatever written above it resturns those string not the AD property whatever i fetches.

Scenario 3: After collecting all the AD property into Array variable if i try to display as below it works.

_ArrayDisplay($array_user[2]).

:graduated::(

Edited by Syed23

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites

If I'm looking at the same functions you're looking at then I see where you might be getting the problems. For example, _AD_GetObjectProperties returns a 2D array, not a string containing the value of the property you're looking for, such as memberof. If you're putting that array into an element of another array, then _ArrayDisplay will only work using your last example, because all of the elements of your $array_user array are arrays themselves.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

good catch


Make yourself sheep and the wolves will eat you - Benjamin Franklin

Share this post


Link to post
Share on other sites

If I'm looking at the same functions you're looking at then I see where you might be getting the problems. For example, _AD_GetObjectProperties returns a 2D array, not a string containing the value of the property you're looking for, such as memberof. If you're putting that array into an element of another array, then _ArrayDisplay will only work using your last example, because all of the elements of your $array_user array are arrays themselves.

Yeah.. I hope this will help me. I will give try and let you know the result..


Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

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  
Followers 0