Sign in to follow this  
Followers 0
NegativeNrG

how to save WHOLE txt file to txt file?

4 posts in this topic

Im working on my Text Editor and i dont know how to save the WHOLE text written in the EDIT box.

heres my Sample code:

$Form1 = GUICreate("Simple Text v0.1", 477, 299, 199, 129)
$Edit1 = GUICtrlCreateEdit("", 8, 32, 465, 249, -1, $WS_EX_CLIENTEDGE)
GUIctrlsetdata($Edit1,"")
$menu = GUIctrlcreatemenu("File")
$item1 = GUIctrlcreatemenuitem("Open",$menu)
$item = GUIctrlcreatemenuitem("Save As..",$menu)
GUISetState(@SW_SHOW)

While 1
       $msg = GUIgetmsg()
        Select
     Case $msg = $GUI_EVENT_CLOSE
ExitLoop

Case $msg = $item
$save = FileSaveDialog("Save To..","C:\","Text Documents(*.txt)",16)
FileWrite($save,$Edit1)

The FileWrite doesnt work, ive tried FileWriteline, but also doesnt work. Can anyone help me?


[size=20]My File Upload[/size]Register at my site and upload.

Share this post


Link to post
Share on other sites



oops, Sorry for Double Threading, i lagged, and pressed back,new topic a couple of times.


[size=20]My File Upload[/size]Register at my site and upload.

Share this post


Link to post
Share on other sites

hello

I think that you save the reference of the EditBox and not the Data.

You must use GUICtrlRead to get the data from the EditBox and save them.

FileWrite($save, GuictrlRead($Edit1))

Share this post


Link to post
Share on other sites

yeh, problem solved in the other Thread of this.


[size=20]My File Upload[/size]Register at my site and upload.

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