Dx3 Posted May 20, 2006 Share Posted May 20, 2006 Hi again everyone, I was wondering, if I have a WritetoLine command in a script, every time it writes a new line, how to do I get it go to the next line, ex. I don't want it to overwrite line 2, I want it to go to line 3 and write. Does anyone get that? Thanks so much, -Dalton Link to comment Share on other sites More sharing options...
ChrisL Posted May 20, 2006 Share Posted May 20, 2006 as per the help file $file = FileOpen("test.txt", 1) ;,1 openswith append to end of file ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "my line of text") FileClose($file) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Dx3 Posted May 20, 2006 Author Share Posted May 20, 2006 Ok, thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted May 20, 2006 Developers Share Posted May 20, 2006 or just: FileWriteLine("Test.txt", "my line of text") 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 comment Share on other sites More sharing options...
Valuater Posted May 20, 2006 Share Posted May 20, 2006 (edited) also... there is FileWriteToLine() where you can choose which line you want to write to example #include <File.au3> ;Example: Write to line 3 of c:\test.txt REPLACING line 3 _FileWriteToLine("c:\test.txt", 3, "my replacement for line 3", 1) ;Example: Write to line 3 of c:\test.txt NOT REPLACING line 3 _FileWriteToLine("c:\test.txt", 3, "my insertion", 0) 8) Edited May 20, 2006 by Valuater 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