davykiash Posted May 22, 2006 Share Posted May 22, 2006 i came up with the following code which reads text from an edit control in a text file i get an error.were am i going wrong? $file = FileOpen("D:\Davy\AutoScripts\send.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; write the values of editboxes text into the textfile Run("D:\Davy\AutoScripts\send\prjSend.exe") WinWait("Form1") FileWriteLine($file, GUICtrlRead ("TEdit2")) FileWriteLine($file, GUICtrlRead ("TEdit1")) Link to comment Share on other sites More sharing options...
Don N Posted May 22, 2006 Share Posted May 22, 2006 From the docs: Mode (read or write) to open the file in. 0 = Read mode 1 = Write mode (append to end of file) 2 = Write mode (erase previous contents) Both write modes will create the file if it does not already exist. When you set mode to 0 you are openign the file for reading, not writing. Use 1 or 2 in order to write to the file after opening it. Hope this helps. _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
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