Jump to content

Save Memo


tom35i
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...