primer Posted January 5, 2007 Posted January 5, 2007 Hey guys, I have two Array variables that get assigned values, and then I would like to write all of the data in each array to a file (not just one array node at a time). So my question is how do I target the entire Array data instead of one particular node? For example: Do $ind = $ind + 1 $str1[$ind] = $someVar $str2[$ind] = $anotherVar While blahblah $file = FileOpen("test.txt", 1) FileWrite($file, $str1 + @CRLF + $str2) FileClose($file) doesn't write anything. I've tried $str1[], etc but I cant figure it out.
martin Posted January 5, 2007 Posted January 5, 2007 Hey guys, I have two Array variables that get assigned values, and then I would like to write all of the data in each array to a file (not just one array node at a time). So my question is how do I target the entire Array data instead of one particular node? For example: Do $ind = $ind + 1 $str1[$ind] = $someVar $str2[$ind] = $anotherVar While blahblah $file = FileOpen("test.txt", 1) FileWrite($file, $str1 + @CRLF + $str2) FileClose($file) doesn't write anything. I've tried $str1[], etc but I cant figure it out. I don't think there is a way to save an array the way you want in Autoit. I think you will have to save every element, and read every element back. If I'm wrong then apologies and I'd be interested to know. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
primer Posted January 5, 2007 Author Posted January 5, 2007 (edited) this way works $newstr = "[" & $str1[0] $newstr2 = "[" & $str2[0] For $i = 1 to 64 $newstr = $newstr & "," & $str1[$i] $newstr2 = $newstr2 & "," & $str2[$i] Next $newstr = $newstr & "]" $newstr2 = $newstr2 & "]" MsgBox(0, '', $newstr, 1) $file = FileOpen("test.txt", 1) FileWrite($file, $newstr & @CRLF & $newstr2) FileClose($file) Edited January 5, 2007 by primer
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