Alexxander Posted March 28, 2014 Posted March 28, 2014 (edited) hi i had made 2 scripts server and clinet part of server code While 1 $accept = TCPAccept($socket) $recive = TCPRecv($accept, 1000000) If $recive = "hi" Then _ArrayAdd($Array,$recive) GUICtrlSetData($list, _ArrayToString($Array)) EndIf WEnd when im sending a tcp from the clint the data is viewd more than once in the list for example when i send "hi" from the clinet it must make one item in the gui named list "hi" but im gettign about 4 "hi" in the list is thier is any way to only view one "hi" and never view it more than once ? client TCPStartup() $socket = TCPConnect("192.168.1.111", 90) TCPSend($socket, "hi") Edited March 28, 2014 by Alexxander
TechCoder Posted March 29, 2014 Posted March 29, 2014 one 'super simple' way..... Local $gotit = 0 While 1 $accept = TCPAccept($socket) $recive = TCPRecv($accept, 1000000) If Not $gotit And $recive = "hi" Then $gotit = 1 _ArrayAdd($Array,$recive) GUICtrlSetData($list, _ArrayToString($Array)) EndIf WEnd
TechCoder Posted March 29, 2014 Posted March 29, 2014 and, of course, there is a function for that...... http://www.autoitscript.com/autoit3/docs/libfunctions/_ArrayUnique.htm
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