DaLiMan Posted July 1, 2004 Posted July 1, 2004 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
Developers Jos Posted July 1, 2004 Developers Posted July 1, 2004 (edited) Maybe you should look at my example again The for..next loop is your solution.... Edited July 1, 2004 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.
DaLiMan Posted July 1, 2004 Author Posted July 1, 2004 Maybe you should look at my example again 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....
Developers Jos Posted July 1, 2004 Developers Posted July 1, 2004 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.
DaLiMan Posted July 2, 2004 Author Posted July 2, 2004 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...... Anyway, I'll keep looking for another way still....Thanx so much for the help again!
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