Re: ListView



"Gabriel Saenz" <gsaenz@xxxxxxxxxxxxxxxxx> wrote in message
news:14qdne__SIL1taPYnZ2dnUVZ_oudnZ2d@xxxxxxxxxxxxxxx

It appears that there is no way to make an exclusionary filter for a
ListView. Is there a way that I could search the listview and remove
files from it that matched a pattern?

Example:
I have a directory of various files. I only want to show files which DO
NOT have the extension ".lav" -- all other files will be displayed.
This is so I can process those files. The *.lav" files have already been
processed. Is there a better way to do this? Perhaps someone knows some
way to make delphi look at a directory, check the file extension and
ignore *.lav files? I don't need to display those files, I just need to
process them if they haven't already been processed.

I think you're confusing a couple of things here. (Either that, or I am.
Completely possible, has happened before - but remember, I only know
what you tell me.)

The listview itself has no idea what items are in it. You are creating
the TListItems; you can decide not to create some of them.

That decision can be based on a function that tries to match a filename
against a filemask. Such a function is in the run-time library, I think,
although I haven't used it. Applying the 'not' operator to the return
value from this function is left as an exercise to the reader.

If you have a population of objects (files) and want to process them
all, except those that have already been processed, perhaps it would
be convenient to fit them all out with a flag that says that they
haven't been processed yet, and _set_ this flag in the objects you
want to exclude, that is, the ones that do match '*.lav'.

Groetjes,
Maarten Wiltink


.