Michael36 Posted October 23, 2005 Share Posted October 23, 2005 Hi all i need a bit of help on the IF in my script ;---click button----------------------------------------------- If $msg = $Button_12 then ;-----send data from input to edit-------------------------------------------- GUICtrlSetData($Edit_10, GUICtrlRead($Edit_10) & GUICtrlRead($Input_11) & @CRLF ) i'm stuck here i need to read $Input_11 it's a input if it Contains "/" i then need to use the StringTrimleft to rid the / before it hits the TCPSend then elseif the input dose not Contain "/" i just need it to TCPSend($socket,"PRIVMSG:"&GUICtrlRead($Input_11)&@LF) button $Button_12 is a send button any ideas on this ? i was thinking of using the Select /EndSelect on this but i just don't know thank you michael If GUICtrlRead($Input_11) = "/" Then $re = StringTrimleft($Input_11, 1) TCPSend( $socket, $re) elseif GUICtrlRead($Input_11) = "" Then TCPSend($socket,"PRIVMSG:"&GUICtrlRead($Input_11)&@LF) endif endif Link to comment Share on other sites More sharing options...
Michael36 Posted October 23, 2005 Author Share Posted October 23, 2005 i think i fig out my prob it's $re = StringTrimleft ,&GUICtrlRead($Input_11) , 1) i left the GUICtrlRead out can GUICtrlRead($Input_11) be placed in a StringTrimleft ? Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2005 Developers Share Posted October 23, 2005 try: If StringRight(GUICtrlRead($Input_11),1) = "/" Then 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...
Michael36 Posted October 23, 2005 Author Share Posted October 23, 2005 try:If StringRight(GUICtrlRead($Input_11),1) = "/" Theni don't understand this If StringRight(GUICtrlRead($Input_11),1) = "/" Theni'm trying to trim the / of the word for Example /hi i need to trim the / so it's just hi my bit of code if GUICtrlRead($Input_11) = "/" Then $result = StringTrimLeft($Input_11), 3) MsgBox(4096, "Test",$result , 0) Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2005 Developers Share Posted October 23, 2005 (edited) i don't understand this If StringRight(GUICtrlRead($Input_11),1) = "/" Theni'm trying to trim the / of the word for Example /hi i need to trim the / so it's just hi my bit of code if GUICtrlRead($Input_11) = "/" Then $result = StringTrimLeft($Input_11), 3) MsgBox(4096, "Test",$result , 0)Thought you wanted to check for trailing "/"To trim a leading slash you can:$result = GUICtrlRead($Input_11) If StringLeft($result ,1) = "/" Then $result = StringTrimLeft($result ,1) EndIf Edited October 23, 2005 by JdeB 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...
BigDod Posted October 23, 2005 Share Posted October 23, 2005 (edited) i don't understand this If StringRight(GUICtrlRead($Input_11),1) = "/" Theni'm trying to trim the / of the word for Example /hi i need to trim the / so it's just hi my bit of code if GUICtrlRead($Input_11) = "/" Then $result = StringTrimLeft($Input_11), 3) MsgBox(4096, "Test",$result , 0)Tryif StringRight(GUICtrlRead($Input_11),1) = "/" Then $result = StringTrimLeft($Input_11), 3) MsgBox(4096, "Test",$result , 0)What it does is read the first letter of the input and checks to see it is "/". If it is it will then strip it off.Edit-Beaten again, must learn to type faster. :"> :"> Edited October 23, 2005 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Michael36 Posted October 23, 2005 Author Share Posted October 23, 2005 Tryif StringRight(GUICtrlRead($Input_11),1) = "/" Then $result = StringTrimLeft($Input_11), 3) MsgBox(4096, "Test",$result , 0)What it does is read the first letter of the input and checks to see it is "/". If it is it will then strip it off.Edit-Beaten again, must learn to type faster. :"> :">thank you guys fo the help would be lost without it your examples are working but for some reson it will not send tcpbut if i use a msgbox as a test it will work the / will be gone so i just have to fig out why it will not send tcp . If $msg = $Button_12 Then $result = GUICtrlRead($Input_11) If StringLeft($result ,1) = "/" Then $result = StringTrimLeft($result ,1) EndIf TCPSend($socket,$result) Link to comment Share on other sites More sharing options...
markusss Posted October 23, 2005 Share Posted October 23, 2005 Did you define $socket as a TCPConnect socketID somewhere in your script? Like: $socket = TCPConnect("192.168.1.1",23) Here's the helpfile: TCPSend ( socket, data ) Parameters -socket: The main socket identifier (SocketID) as returned by a TCPConnect function. -data: binary/string to be send to the connected socket Link to comment Share on other sites More sharing options...
Michael36 Posted October 24, 2005 Author Share Posted October 24, 2005 yes i define $socket i will just keep at it i will get it lol never give up thank you 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