nitekram Posted April 4, 2006 Share Posted April 4, 2006 I must be reading it wrong - but I would think that the UDF would bring the first line back (text and all) - but this must not be right because everytime I use it - the value is 0 (ZERO) Func writeINI();_GUICtrlEditGetFirstVisibleLine($h_edit) - _GUICtrlEditGetLineCount($h_edit) $fileINIname = $filenameDEFAULT MsgBox(0,$fileINIname,$fileINIname & " " & _GUICtrlEditGetFirstVisibleLine($GUI_TEXT_USER)) $firstLine = _GUICtrlEditGetFirstVisibleLine($GUI_TEXT_USER) IniWrite ( $fileINIname, @MON & @MDAY & @YEAR, @HOUR & @MIN, GUICtrlRead($GUI_TEXT_USER)) IniWrite ( $fileINIname, @MON & @MDAY & @YEAR, @HOUR & @MIN, $firstLine ) EndFunc ; neither of the IniWrite call gives me the value of the first line - how should I use it or better yet is it even possible? Thanks for your time, 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
GaryFrost Posted April 4, 2006 Share Posted April 4, 2006 #include <GUIConstants.au3> #include <GuiEdit.au3> opt('MustDeclareVars', 1) Dim $myedit, $Status, $msg, $Btn_GET Const $EM_GETLINE = 0xC4 GUICreate("Edit Line Length", 392, 254) $myedit = GUICtrlCreateEdit("First line" & @CRLF, 140, 32, 121, 97, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE)) GUICtrlSetLimit($myedit, 1500) $Status = GUICtrlCreateLabel("", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) $Btn_GET = GUICtrlCreateButton("Get", 150, 130, 90, 40, $BS_MULTILINE) ; will be append dont' forget 3rd parameter GUICtrlSetData($myedit, "2nd line" & @CRLF & "3rd line" & @CRLF & "4th line" & @CRLF & _ "5th line" & @CRLF & "6th line" & @CRLF & "7th line" & @CRLF & "8th line" & @CRLF & "9th line", 1) GUISetState() ;******************************************************************************** ; the controlcommand in the next statement is what you need to look at ;******************************************************************************** GUICtrlSetData($Status, "Line 0: " & ControlCommand("Edit Line Length","","Edit1","GetLine",1)) ;******************************************************************************** ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Btn_GET GUICtrlSetData($Status, "Line Length: " & _GUICtrlEditLineLength ($myedit)) EndSelect WEnd SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
nitekram Posted April 4, 2006 Author Share Posted April 4, 2006 #include <GUIConstants.au3> #include <GuiEdit.au3> opt('MustDeclareVars', 1) Dim $myedit, $Status, $msg, $Btn_GET Const $EM_GETLINE = 0xC4 GUICreate("Edit Line Length", 392, 254) $myedit = GUICtrlCreateEdit("First line" & @CRLF, 140, 32, 121, 97, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE)) GUICtrlSetLimit($myedit, 1500) $Status = GUICtrlCreateLabel("", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) $Btn_GET = GUICtrlCreateButton("Get", 150, 130, 90, 40, $BS_MULTILINE) ; will be append dont' forget 3rd parameter GUICtrlSetData($myedit, "2nd line" & @CRLF & "3rd line" & @CRLF & "4th line" & @CRLF & _ "5th line" & @CRLF & "6th line" & @CRLF & "7th line" & @CRLF & "8th line" & @CRLF & "9th line", 1) GUISetState() ;******************************************************************************** ; the controlcommand in the next statement is what you need to look at ;******************************************************************************** GUICtrlSetData($Status, "Line 0: " & ControlCommand("Edit Line Length","","Edit1","GetLine",1)) ;******************************************************************************** ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Btn_GET GUICtrlSetData($Status, "Line Length: " & _GUICtrlEditLineLength ($myedit)) EndSelect WEnd I am not sure if I made myself clear - I do that a lot. What I need is a way to read the text from a input control and save it to a variable - is this possible and if so what is the function to get it. The one that is above gives me the number of characters after I add some - maybe I am just not getting it. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
GaryFrost Posted April 4, 2006 Share Posted April 4, 2006 I am not sure if I made myself clear - I do that a lot. What I need is a way to read the text from a input control and save it to a variable - is this possible and if so what is the function to get it. The one that is above gives me the number of characters after I add some - maybe I am just not getting it.did you even try it?it returned the first line for me in the status bar. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
nitekram Posted April 4, 2006 Author Share Posted April 4, 2006 did you even try it? it returned the first line for me in the status bar. I added the following to your code - msgbox While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Btn_GET GUICtrlSetData($Status, "Line Length: " & _GUICtrlEditLineLength ($myedit)) MsgBox(0, _GUICtrlEditLineLength ($myedit), _GUICtrlEditLineLength ($myedit)) EndSelect WEnd From your example it shows the number 8 when I press the get button - I need the text not the number of chars...does this make sense? 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
GaryFrost Posted April 4, 2006 Share Posted April 4, 2006 I added the following to your code - msgbox While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Btn_GET GUICtrlSetData($Status, "Line Length: " & _GUICtrlEditLineLength ($myedit)) MsgBox(0, _GUICtrlEditLineLength ($myedit), _GUICtrlEditLineLength ($myedit)) EndSelect WEnd From your example it shows the number 8 when I press the get button - I need the text not the number of chars...does this make sense? should of paid attention to the below in the above script: ;******************************************************************************** ; the controlcommand in the next statement is what you need to look at ;******************************************************************************** GUICtrlSetData($Status, "Line 0: " & ControlCommand("Edit Line Length","","Edit1","GetLine",1)) ;******************************************************************************** SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
nitekram Posted April 4, 2006 Author Share Posted April 4, 2006 should of paid attention to the below in the above script: ;******************************************************************************** ; the controlcommand in the next statement is what you need to look at ;******************************************************************************** GUICtrlSetData($Status, "Line 0: " & ControlCommand("Edit Line Length","","Edit1","GetLine",1)) ;******************************************************************************** Sorry once again - I did not know what you were stating - I thought that the button press had something to do with it. Now I see once I run the script the message is equal to what I want. Again sorry - I am still very new to programming and still want to learn but IT IS HARD. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator 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