Jump to content
Sign in to follow this  
tom35i

Save Memo

Recommended Posts

tom35i

Hey all

I am trying to save the contents of a memo to a text file.

the memo is created using the following

$hGUI = GUICreate("SOC", 600, 300)
    $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 296, $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")

any able to help?

cheers


YEA BOIhttp://www.myspace.com/comeoutfiringhttp://www.last.fm/music/comeoutfiringhttp://www.facebook.com/pages/comeoutfiring/75676261698http://www.reverbnation.com/comeoutfiringhttp://www.purevolume.com/comeoutfiringhttp://www.twitter.com/comeoutfiringhttp://www.youtube.com/comeoutfiring

Share this post


Link to post
Share on other sites
Mat

This?

#Include<WindowsConstants.au3>

$hGUI = GUICreate("SOC", 600, 322)
   $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 296, $WS_VSCROLL)
   GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")

   $hSave = GUICtrlCreateButton ("Save", 2, 300, 80, 20)

GUISetstate ()

While 1
   Switch GUIGetMsg ()
      Case -3
         Exit
      Case $hSave
         _Save (GUICtrlRead ($iMemo), $hGUI)
   EndSwitch
WEnd

Func _Save ($sText, $hParent)
   Local $sFile = FileSaveDialog ("Save memo...", @WorkingDir, "Text file (*.txt)|All files (*.*)", 18, "", $hParent)
   If @Error Then Return 0
   Local $hFile = FileOpen ($sFile, 2)
      FileWrite ($hFile, $sText)
   FileClose ($hFile)
   Return 1
EndFunc ; ==> _Save

Mat

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.