Jump to content

ListView: deleting top-so many rows


ycomp
 Share

Recommended Posts

Hi, how can I delete the top 'x' rows of a list view... or actually what I want to do is to keep the bottom, let's say, 500 rows and delete all above it.

I wrote a crude debugging console using a listview and I'm worried about it consuming a huge amount of memory over a long period of time. So I'd like to only display the last 500 rows most of the time.

p.s. this is unrelated to my other listview question about memory leaks that was answered. That one is a different type of app.

Link to comment
Share on other sites

Hi, how can I delete the top 'x' rows of a list view... or actually what I want to do is to keep the bottom, let's say, 500 rows and delete all above it.

I wrote a crude debugging console using a listview and I'm worried about it consuming a huge amount of memory over a long period of time. So I'd like to only display the last 500 rows most of the time.

p.s. this is unrelated to my other listview question about memory leaks that was answered. That one is a different type of app.

Can't you use _GUICtrlListView_DeleteItem?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I am really new to this autoit listview stuff... how do I retrieve the row for a list view item?

also, is there no comand to delete an entire row?

also, I noticed a _GUICtrlListView_DeleteItemsSelected command... would it be faster to select items and then delete using this command, or will it be same speed as _GUICtrlListView_DeleteItem? (i would turn off updating before using either method)

Link to comment
Share on other sites

I am really new to this autoit listview stuff... how do I retrieve the row for a list view item?

also, is there no comand to delete an entire row?

also, I noticed a _GUICtrlListView_DeleteItemsSelected command... would it be faster to select items and then delete using this command, or will it be same speed as _GUICtrlListView_DeleteItem? (i would turn off updating before using either method)

An Item is a "Row".

If you created the Item(s) using the GuiCtrlCreateListViewItem then you'll need to use GuiCtrlDelete as I showed you in the other thread.

You could get the count then minus 500 from the starting point and work to zero from there on the delete.

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

An Item is a "Row".

If you created the Item(s) using the GuiCtrlCreateListViewItem then you'll need to use GuiCtrlDelete as I showed you in the other thread.

You could get the count then minus 500 from the starting point and work to zero from there on the delete.

ok, thanks for the help.. I implemented that delete already this morning for the other project as you suggested.

now it's coming back to... starting to remember from my delphi days.. there is an item with a bunch of subitems. Easier than I thought, I was thinking each item was a cell... forgot I was adding the "cells" using those separator chars

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...