Jump to content

Recommended Posts

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
Link to post
Share on other sites
  • Developers

Maybe you should look at my example again :D

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

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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....

Link to post
Share on other sites
  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...