D4rk^S0ul Posted September 15, 2005 Share Posted September 15, 2005 $savetext = GuiCtrlCreateMenu("Save") $Edit_1 = GUICtrlCreateEdit("", 5, 45, 230, 130) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Case $msg = $savetext $edit_2 = GuiCtrlRead($Edit_1) $file = FileOpen("test.txt", 1) FileWrite($file, $edit_2) That is my code so far can any1 help me to see what is wrong with this? Link to comment Share on other sites More sharing options...
Developers Jos Posted September 15, 2005 Developers Share Posted September 15, 2005 $savetext = GuiCtrlCreateMenu("Save") $Edit_1 = GUICtrlCreateEdit("", 5, 45, 230, 130) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Case $msg = $savetext $edit_2 = GuiCtrlRead($Edit_1) $file = FileOpen("test.txt", 1) FileWrite($file, $edit_2)That is my code so far can any1 help me to see what is wrong with this?<{POST_SNAPBACK}>This is the whole script ????????????? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
D4rk^S0ul Posted September 15, 2005 Author Share Posted September 15, 2005 no thats the example of wat writes the file i dont see why this does not work, i normally get a random number in the file instead of the text Link to comment Share on other sites More sharing options...
Developers Jos Posted September 15, 2005 Developers Share Posted September 15, 2005 no thats the example of wat writes the file i dont see why this does not work, i normally get a random number in the file instead of the text<{POST_SNAPBACK}>If you have a question it helps when you give a working script and you explain exactly what is going wrong... that saves a lot of "Let guess what his problem is" posts... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
seandisanti Posted September 15, 2005 Share Posted September 15, 2005 $savetext = GuiCtrlCreateMenu("Save") $Edit_1 = GUICtrlCreateEdit("", 5, 45, 230, 130) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Case $msg = $savetext $edit_2 = GuiCtrlRead($Edit_1) $file = FileOpen("test.txt", 1) FileWrite($file, $edit_2)That is my code so far can any1 help me to see what is wrong with this?<{POST_SNAPBACK}>Case $msg = $savetext $file = FileOpen("test.txt", 1) FileWrite($file, GuiCtrlRead($edit_1)) FileClose($file) EndSelectyou may have other issues in the script if that's not working, you may want to post a larger listing of the code, atleast all parts that concern variables or statements in segment listed... Link to comment Share on other sites More sharing options...
D4rk^S0ul Posted September 15, 2005 Author Share Posted September 15, 2005 (edited) expandcollapse popup#include <GUIConstants.au3> Opt("TrayIconHide", 1) GUICreate("QuickPad",240,180) $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenuitem ("Recent Files:",$filemenu) $fileexit = GuiCtrlCreateMenuItem ("Exit",$filemenu) $savetext = GuiCtrlCreateMenu("Save") $Edit_1 = GUICtrlCreateEdit("", 5, 45, 230, 130) GUISetState() While(1) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $fileexit Exitloop Case $msg = $savetext $edit_2 = GuiCtrlRead($Edit_1) $file = FileOpen("test.txt", 1) FileWrite($file, GuiCtrlRead($edit_1)) FileClose($file) Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"(*.txt)") If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu) EndSelect Wend This isent goin to be a used program just for my own learning really. Edited September 15, 2005 by D4rk^S0ul Link to comment Share on other sites More sharing options...
Developers Jos Posted September 15, 2005 Developers Share Posted September 15, 2005 Case $msg = $savetext is never true because $savetext is not a MenuItem... Try: expandcollapse popup#include <GUIConstants.au3> Opt("TrayIconHide", 1) GUICreate("QuickPad",240,180) $filemenu = GuiCtrlCreateMenu ("File") $fileitem = GuiCtrlCreateMenuitem ("Open...",$filemenu) $recentfilesmenu = GuiCtrlCreateMenuitem ("Recent Files:",$filemenu) $fileexit = GuiCtrlCreateMenuItem ("Exit",$filemenu) $savetext = GUICtrlCreateMenuitem("Save",-1) $Edit_1 = GUICtrlCreateEdit("", 5, 45, 230, 130) GUISetState() While(1) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $fileexit Exitloop Case $msg = $savetext $edit_2 = GuiCtrlRead($Edit_1) $file = FileOpen("test.txt", 1) FileWrite($file, GuiCtrlRead($edit_1)) FileClose($file) Case $msg = $fileitem $file = FileOpenDialog("Choose file...",@TempDir,"(*.txt)") If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu) EndSelect Wend SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
D4rk^S0ul Posted September 15, 2005 Author Share Posted September 15, 2005 Thanks works gr8 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now