blublub Posted August 17, 2007 Share Posted August 17, 2007 (edited) #include <File.au3> HotKeySet("1","write") Func write() _FileWriteToLine("d:\zz\zz.au3",1,"xxx",0) _FileWriteToLine("d:\zz\zz.au3",1,"zzz",0) Endfunc Do sleep(100) Until 0 thats my test script and when i press few times key "1" i fought i will get the file looking like that : " xxxzzzxxxzzzxxxzzz" but instead i get something like this:" xxx zzz xxx zzz xxx zzz " why its moving to lower lines when i have line 1 in the function _FileWriteToLine ? edit: i know now why its doing like this its just moving the existing lines lower to place wanted strings but how can i change it and force it to add strings at end of wanted line ? Edited August 17, 2007 by blublub Link to comment Share on other sites More sharing options...
Monamo Posted August 17, 2007 Share Posted August 17, 2007 #include <File.au3> HotKeySet("1","write") Func write() _FileWriteToLine("d:\zz\zz.au3",1,"xxx",0) _FileWriteToLine("d:\zz\zz.au3",1,"zzz",0) Endfunc Do sleep(100) Until 0 thats my test script and when i press few times key "1" i fought i will get the file looking like that : " xxxzzzxxxzzzxxxzzz" but instead i get something like this:" xxx zzz xxx zzz xxx zzz " why its moving to lower lines when i have line 1 in the function _FileWriteToLine ? edit: i know now why its doing like this its just moving the existing lines lower to place wanted strings but how can i change it and force it to add strings at end of wanted line ? I may be misreading the function inside of File.au3, but it looks like since you're not overwriting the line (flag of "0"), it's inserting the new lines in place of line 1 and bumping the rest down. If you're wanting to generate one continuous string of text on line 1, I'd recommend doing a FileReadLine of line one to a variable, then appending the text you want added. - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
weaponx Posted August 17, 2007 Share Posted August 17, 2007 Just use FileWrite, it won't append carriage return to end of line. Link to comment Share on other sites More sharing options...
blublub Posted August 17, 2007 Author Share Posted August 17, 2007 thx Monamo and weaponx 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