Sign in to follow this  
Followers 0
DaLiMan

Send (an array)

5 posts in this topic

After some troubles I finaly managed to get the _FileReadToArray function working. (many thanx again to JdeB)

But now after scripting the rest I find that the one thing I need the most isn't working. I want to SEND the array (text) to an excell file.

But a simple script like below doesn't even work in notepad.....

What am I missing here? Can't the array be SEND or is this done another way?

#include <file.au3>     
Dim $AARRAY

; perform the _FileReadtoArray function and when the returncode = 1 show the number of records and all record contents
If _FileReadToArray("C:\File.txt", $AARRAY) Then 
  MsgBox(0, "Array Output records", $AARRAY[0])
  For $X = 1 To $AARRAY[0]
   MsgBox(0, "Record " & $X, $AARRAY[$X])
   Run("Notepad.exe", "", @SW_MAXIMIZE)
   Sleep(750)
   Send($AARRAY)
   Send("Tekst")
  Next
Else
; returncode was 0 so the function reported that the file doesn't exist
  MsgBox(0, "Error", "Error from Function")
EndIf

Exit

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe you should look at my example again :D

The for..next loop is your solution....

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Maybe you should look at my example again  :D

The for..next  loop is your solution....

OK, made the code like this and it's working.

But do you have to SEND the lines one by one?

Can't I just send the entire file in one time?

#include <file.au3>     
Global $AARRAY

; perform the _FileReadtoArray function and when the returncode = 1 show the number of records and all record contents

If _FileReadToArray("C:\File.txt", $AARRAY) Then 
  MsgBox(0, "Array Output records", $AARRAY)
   Run("Notepad.exe", "", @SW_MAXIMIZE)
    For $X = 1 To $AARRAY[0]
   WinActivate("Untitled - Notepad", "")
   Sleep(750)
   Send($AARRAY[$X] & "{ENTER}")
Next

Else
; returncode was 0 so the function reported that the file doesn't exist
  MsgBox(0, "Error", "Error from Function")
EndIf

Exit

Read ya tomorrow....

Share this post


Link to post
Share on other sites

OK, made the code like this and it's working.

But do you have to SEND the lines one by one?

Can't I just send the entire file in one time?

Its what you want...

I assume you have a purpose for putting it in an Array first... right ?

If thats the case then just send it record by record.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Its what you want...

I assume you have a purpose for putting it in an Array first... right ?

Yes, unfortunatly I do....

But trust me, you don't wanna know...... :huh2:

Anyway, I'll keep looking for another way still....

Thanx so much for the help again! :D

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