Sign in to follow this  
Followers 0
acer20006

Refreshing winlist & delete the repeating dataا

18 posts in this topic

hii all i have script which included winlist _ my problem appeared when i add data to my winlist . winlist keep the the same data even if i add it again . all i wann to to make winlist get ride of the repeating data ( auto refresh it )

so is that possable ?????????!!!

Share this post


Link to post
Share on other sites



any idea ???

Share this post


Link to post
Share on other sites

up :mellow:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Please don't bump your topics within 24 hours.

In general: When you post a clear question with the snippet that shows what you have and demonstrates your problem you find you get help.

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Please don't bump your topics within 24 hours.

In general: When you post a clear question with the snippet that shows what you have and demonstrates your problem you find you get help.

ty jos _ up

Share this post


Link to post
Share on other sites

Your problem very likely is related to trying to refresh the array while you are already reading it in a loop. There are solutions to that but you can't expect any help with it if you don't do as Jos so very politely asked. Post some relevent code so we can actually see where you can make changes.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Your problem very likely is related to trying to refresh the array while you are already reading it in a loop. There are solutions to that but you can't expect any help with it if you don't do as Jos so very politely asked. Post some relevent code so we can actually see where you can make changes.

There are solutions to that but you can't expect any help with it if you don't do as Jos so very :mellow:politely asked.

i asked Twice before about (ListView) _ and politely thay ignoring to answer

http://www.autoitscript.com/forum/index.php?showtopic=109883&st=0&p=772335&#entry772335

http://www.autoitscript.com/forum/index.php?showtopic=109933&st=0&p=772651&#entry772651

and plz read my reply i said( ty jos _ up) what i should do more than that ??

Edited by acer20006

Share this post


Link to post
Share on other sites

and plz read my reply i said( ty jos _ up) what i should do more than that ??

Post the code is the what part (as Jos so politely requested), and don't create multiple threads about the same problem. Do you really think we are going to jump all over the forum looking to see if you have asked the question in another thread? Not too likely to happen.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

and plz read my reply i said( ty jos _ up) what i should do more than that ??

An idea could be to read my whole reply and not just the first sentence?

On top of that it aint to smart to create multiple threads expecting you get better responses, now read that second part and comply to it.. I am sure it will do wonders.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

this's apart of code

> how to Refreshing winlist & delete the repeating data???

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1_1 = GUICreate("Test", 195, 300, 335, 133)
$Status = GUICtrlCreateListView("", 8, 8, 177, 105 ,BitOR($LVS_LIST,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS,$LVS_SORTDESCENDING))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
TCPStartUp()
;~ ; Connect to "SOCKET" :
;=========================
$socket = TCPConnect( $g_IP, 22580 )
If $socket = -1 Then MsgBox (0,"TCP Services","Can't make connection")
While 1
    $Packet = TCPRecv($socket, 10000) 
                If (StringInStr($Packet, "0x180074B60200")) and  (StringInStr($Packet, "45822")) Then  ;  specific packets
                    $data = StringMid($Packet, 15, 8)
                            GUICtrlCreateListViewItem($data, $Status)
                EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

i used _GUICtrlListView_DeleteAllItems before but it doesn't help

__ and also i have problem with

If (StringInStr($Packet, "0x180074B60200")) and  (StringInStr($Packet, "45822")) Then  ;  specific packets
                    $data = StringMid($Packet, 15, 8)
                            GUICtrlCreateListViewItem($data, $Status)
                EndIf

it doesn't work at well

BTW sry if i was nerves with u

Share this post


Link to post
Share on other sites

An idea could be to read my whole reply and not just the first sentence?

On top of that it aint to smart to create multiple threads expecting you get better responses, now read that second part and comply to it.. I am sure it will do wonders.

Jos

i forced to make multiple threads _at the first link you will see that i put all of my question at it (stringInStr , listview , tcp ) >> 41 Views and only one give me answer

(( ok , i willn't make multiple threads again _sry ))

Share this post


Link to post
Share on other sites

Perhaps you better start from the beginning. Your first post in this thread mentions a problem with WinList() and you have not used WinList() at all in the code as far as I can see.

Are you just trying to delete a ListViewItem? The reason I ask is the code also doesn't show where you are attempting to delete anything at all.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

i forced to make multiple threads _at the first link you will see that i put all of my question at it (stringInStr , listview , tcp ) >> 41 Views and only one give me answer

(( ok , i willn't make multiple threads again _sry ))

You are not forced to make multiple thread but we will force you to stick to single threads.

As said:Ask clear questions and you will get answers.

Take your last posted snippet. Do you seriously think its even close to being simple and clear?

I am honestly not trying to make fun of anything here but you are really expecting too much from us.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Perhaps you better start from the beginning. Your first post in this thread mentions a problem with WinList() and you have not used WinList() at all in the code as far as I can see.

Are you just trying to delete a ListViewItem? The reason I ask is the code also doesn't show where you are attempting to delete anything at all.

winlist > Solved sry i forget to tell that

but now i have new Obstacle wih listviewitem ( it's keep adding the same packets from TCPRecv ) i wann to delete the repeated data

and about StringInStr i cant make it work right _ script ignoring it

Share this post


Link to post
Share on other sites

You are not forced to make multiple thread but we will force you to stick to single threads.

As said:Ask clear questions and you will get answers.

Take your last posted snippet. Do you seriously think its even close to being simple and clear?

I am honestly not trying to make fun of anything here but you are really expecting too much from us.

Jos

i know that u didnt try to make fun of anything , but i'm newbie _ and dont know any where alse to ask for help _ i keep tyring to slove my own problem but when it become hopeless :mellow: you know ...

Share this post


Link to post
Share on other sites

winlist > Solved sry i forget to tell that

but now i have new Obstacle wih listviewitem ( it's keep adding the same packets from TCPRecv ) i wann to delete the repeated data

and about StringInStr i cant make it work right _ script ignoring it

Now it's almost clear as mud.

Try this line.

;GUICtrlCreateListViewItem($data, $Status);; This is your existing line, change as follows
If _GUICtrlListView_FindText($status, $data) = -1 Then GUICtrlCreateListViewItem($data, $Status)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Now it's almost clear as mud.

Try this line.

;GUICtrlCreateListViewItem($data, $Status);; This is your existing line, change as follows
If _GUICtrlListView_FindText($status, $data) = -1 Then GUICtrlCreateListViewItem($data, $Status)

it's work _ ty

but what about

If (StringInStr($Packet, "0x180074B60200")) and  (StringInStr($Packet, "45822")) Then  ;  specific packets
                    $data = StringMid($Packet, 15, 8)
                            GUICtrlCreateListViewItem($data, $Status)
                EndIf
my purpose to search for Specific packets started with "0x180074B60200" and included "45822" is that possable _ and thx again for help _ i really appreciate your help

Share this post


Link to post
Share on other sites

Try again. This should be close

If StringRegExp($packet, "(?i)0x180074B60200.*45822.*") Then
    $data = StringMid($Packet, 15, 8)
    If _GUICtrlListView_FindText($status, $data) = -1 Then GUICtrlCreateListViewItem($data, $Status)
EndIf

If that doesn't do it then post a few true examples of $packet without quotes.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0