Minikori Posted September 11, 2008 Share Posted September 11, 2008 (edited) Hey, working on a script that involves adding text to label, but also keeping the old text. I don't think I need to give an example so I won't Thanks in advance. Edited September 11, 2008 by Minikori For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 11, 2008 Share Posted September 11, 2008 You could either keep a string variable with the text on it or set the text to (readtext + "new text"). Link to comment Share on other sites More sharing options...
Minikori Posted September 11, 2008 Author Share Posted September 11, 2008 You could either keep a string variable with the text on it or set the text to (readtext + "new text").I want do do your second idea, except I don't know how to get the current text(read text). For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
cyanidemonkey Posted September 11, 2008 Share Posted September 11, 2008 (edited) $cominednewtext = GUICtrlRead($labelname) & "new test string." GUICtrlSetData($labelname, $cominednewtext) Edited September 11, 2008 by cyanidemonkey My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
Minikori Posted September 11, 2008 Author Share Posted September 11, 2008 $cominednewtext = GUICtrlRead($labelname) & "new test string." GUICtrlSetData($labelname, $cominednewtext)Alright, here's my code, why isn't it working? #include <GUIConstantsEx.au3> #include <Misc.au3> GUICreate("Test", 200, 250) $Input = GUICtrlCreateInput("", 5, 225, 190, 20) $Chat = GUICtrlCreateLabel("", 5, 5, 190, 215) GUISetBkColor(0xFFFFFF) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case _IsPressed("0D") $InputGet = GUICtrlRead($Input) $TextSend = GUICtrlRead($Chat) & $InputGet GUICtrlSetData($Chat, $TextSend & @CRLF) GUICtrlSetData($Input, "") EndSelect WEnd Exit For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
enaiman Posted September 11, 2008 Share Posted September 11, 2008 It is working but ... you aren't fast enough _IsPressed is called too many times while you press the "Enter" key -> too many @CRLF are inserted and your next entry is too far away to be shown. Do an experiment - run your code and do your best to hit the Enter key as fast as you can - you may be able to see the next entry (maybe). You can add also a Sleep(100) after _IsPressed and run it again - it will work, but, if you keep pressed a little longer the enter key - you will see that many lines are added. Here is the fixed code: #include <GUIConstantsEx.au3> #include <Misc.au3> GUICreate("Test", 200, 250) $Input = GUICtrlCreateInput("", 5, 225, 190, 20) $Chat = GUICtrlCreateLabel("", 5, 5, 190, 215) GUISetBkColor(0xFFFFFF) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Input $InputGet = GUICtrlRead($Input) $TextSend = GUICtrlRead($Chat) & $InputGet GUICtrlSetData($Chat, $TextSend & @CRLF) GUICtrlSetData($Input, "") EndSelect WEnd Exit SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) 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