Sign in to follow this  
Followers 0
au3scr

Need help with file save

4 posts in this topic

I am trying to create file (Save as button on my guy)

and i want save new file and create it only with some lines.its hard to describe it.I am trying to explain...

When i made save button that simply overwritten lines in old file then it worked that way.Then I added save as button that must create new file,I creates new file but my problem is that my script wont write any lines on that new file that made with save as button from gui.

1st I tried:

_FileCreate($filename&".lua"); I didnt have that with save button.I added this for save as button

$IsSelected = GUICtrlRead ($orb); == > $orb is check box

If $IsSelected = 1 Then $IsSelected = 'loadfile(dir .. "other\\orb.lua")()' ; == > If check box is selected then write this line

If $IsSelected = 4 Then $IsSelected = '--loadfile(dir .. "other\\orb.lua")() ; == > If check box is not selected then write this line

_FileWriteToLine($filename&".lua",55,$IsSelected,0) ; == > ok here I am trying to write 55 th line for file, but this script creates new empty file but it dont write any text on 55 th line

How i can write that 55 th line when i tell script to make new file?

I need write specific line in new freshly created file.


Share this post


Link to post
Share on other sites



I tried make it more simple. so how i can make it write lines int that file?

#include <File.au3>
;Example: Write to line 3 of c:\test.txt REPLACING line 3
_FileCreate("c:\test.txt")
_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)

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Tnx it worked great muttley


Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0