Results 1 to 5 of 5

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Kyrksæterøra, Norway

    Resolved [RESOLVED] Listview items comparison

    I have a problem with comparing items in a ListView.

    Edit: Well, more precisely, I am having problems comparing properties held within the items .Tag properties... Or, sort of...

    Name:  listview filtering.png
Views: 167
Size:  19.2 KB

    As you can see in the image, player A has his city presented in the ListView multiple times. What I would like to achive is that each and one of his cities are compared, and only the city with the highest points will appear in the list. The players with only one city is easier, I just add them to a "keep this" list and deal with them later.

    However, each ListViewItem has a CityObject object attached to its .Tag property which again holds the properties needed for the comparisons (the ListViewItems are not compared directly):

    These properties are used from CityObject:
    • Id (= city id) (as Long)
    • ServerId (as Integer)
    • CreationTimeFromAppAsDate (as Date)
    • GetPointsTotal (as Long)

    * If two or more of his cities have the same score, the CreationTime property should be used (remove all but the newest), else remove cities based on the score.

    So, doing comparisons like this sound "easy", right? But these things are some of the toughest parts for me to wrap my head around regarding programming, and I have spent literarely two nights now trying to get this to work.

    I need an eureka moment; someone please provide me with some advice on how you would perform comparison tasks like this. Need insight on the logical part...
    Last edited by Arve K.; Mar 7th, 2018 at 08:44 PM.
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.