Sign in to follow this  
Followers 0
metalicaman8

filewrite saves as 1, 2, or3

5 posts in this topic

when I put in

CODE
If $msg = $Save Then

;When you press Save

;~~

$name = FileSaveDialog("Save file", @DesktopDir, "Encrypted Text File (*.txe)")

FileWrite($name&'.txe, $EditText)

EndIf

and save anything I end up with a file that has the correct extension of .txe but when opened in notepad it shows a 3 instead of the saved text. Can somebody tell me what is wrong with my saving script?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

when I put in

CODE
If $msg = $Save Then

;When you press Save

;~~

$name = FileSaveDialog("Save file", @DesktopDir, "Encrypted Text File (*.txe)")

FileWrite($name&'.txe, $EditText)

EndIf

and save anything I end up with a file that has the correct extension of .txe but when opened in notepad it shows a 3 instead of the saved text. Can somebody tell me what is wrong with my saving script?
You don't show the code for where you get/set the value for $EditText, but I suspect that it's from something like

$EditText = GuiCtrlCreateEdit(.......)

In which case, your capturing the instance number of the gui created element.

You need something like

$EditedText = GuiControlRead($EditText)

then

FileWrite($name&'.txe, $EditedText)
Edited by ResNullius

Share this post


Link to post
Share on other sites

One more question. If I compile it to an exe and it has

CODE
#include <guiconstants.au3>

#include <string.au3>

If I move it to another computer do I need to move these files? Should I copy paste them into my code instead?

Share this post


Link to post
Share on other sites

No you don't. The include function compiles the library in the brackets right into the exe.


[center]JSON Encoding UDF[/center]

Share this post


Link to post
Share on other sites

thanks. It works now thanks to you guys. It is an edited version of the encryption tool that comes as an example. It saves the file as a .txe and opens .txe files. It also remembers the level of encryption and automatically sets it when you open a .txe file.

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