Sign in to follow this  
Followers 0
l00natech

How can I put this array to a file?

4 posts in this topic

Hi anyone...

I'm new to Autoit,a noob scripter, and not a programmer. But i'm starting to like this kind of scripting though...

This code of water's intrigue me as such that i need this code to work for me.

That's why i started to join the forum instead of googling to death for sample codes.

I'm out of luck on this one...

I hope somebody can help me...

#include <ad.au3>

_AD_Open()

$aProperties = _AD_GetObjectProperties(@UserName)
_ArrayDisplay($aProperties, "Active Directory Functions - Example 1 - Properties for user '" & @UserName & "'")

_AD_Close()

As you see on the above script, it displays a popup output by Autoit querying an Active Directory. I want it to be put in a file.

All i know is that it cannot be directed easily to a variable. And I can only direct simple data in a variable and not from an array yet.

Also found info on _FileWriteFromArray but i started to loose my patience on getting this thing to work for me... I felt very retarded now... hope somebody could help...

Thank you very much in advance...

Share this post


Link to post
Share on other sites



So before you started to lose your patience, what did you find out about _FileWriteFromArray and what else did you try that didn't work right either?


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

So before you started to lose your patience, what did you find out about _FileWriteFromArray and what else did you try that didn't work right either?

Hi somdcomputerguy! :)

So far i've this code...

But I'm having errors... :)

#include<File.au3>
#include <ad.au3>

_AD_Open()

Global $aProperties[1][2]
$File = @TempDir & "\Test2.txt"

$aProperties = _AD_GetObjectProperties(@UserName)
_ArrayDisplay($aProperties, "Active Directory Functions - Example 1 - Properties for user '" & @UserName & "'")

_FileWriteFromArray ($File, $aProperties)


; Display results
Run("notepad.exe " & $File)

_AD_Close()

It displays the array... after that...

This is the error... I don't understand what it means???

C:\Program Files\AutoIt3\Include\File.au3 (256) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

If FileWrite($hFile, $a_Array[$x] & @CRLF) = 0 Then

If FileWrite($hFile, ^ ERROR

>Exit code: 1 Time: 5.520

Can you tell me the syntax for this _FileWriteFromArray?

sorry for being a noob... :P

I know you guys can handle this far greater than i did...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It seems you fail to get array correctly, make sure you really have the valid array before trying to write it

_AD_GetObjectProperties(@UserName)

Never saw something like this before, are you sure this gives you valid array?

Shouldnt it be _AD_GetObjectProperties($UserName)

Need more details :)

Edited by Aktonius

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