Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: CrAz3D on March 01, 2004, 09:51 PM

Title: ListView Skip
Post by: CrAz3D on March 01, 2004, 09:51 PM
I am trying to find a user, by an index, remove the user, & the re-add the user w/new updated flags.

The code makes it skip everyother user (ie Userlist = Telos, Pyhric, Ban... it will only modify Telos & Ban while totally leaving Pyhric's flags blank)

I think the problem may lie within my loopsing & removing code


for i =1 to FrmDb.DB.ListItems.Count
    'replace flag junk
frmdb.db.listitems(i).remove
frmdb.db.listitems.add,,username
    frmdb.db.listitems(i).add,,flags

next i


EDIT:
Using

frmdb.db.listitems(frmdb.db.listitems.count)
or
frmdb.db.listitems(frmdb.db.finditem(origuser).index)


Makes the entire thing loop through twice skipping people & adding flags twice that users already have.
Title: Re:ListView Skip
Post by: CrAz3D on March 01, 2004, 11:35 PM
It seems as though that I am true to my signature.  I just had to use the same index# when re-adding the username & flags.

i3 = frmDB.DB.FindItem(OrigUser).Index
           frmDB.DB.ListItems.Remove (i3)
           frmDB.DB.ListItems.Add i3, , OrigUser
               frmDB.DB.ListItems(i3).ListSubItems.Add , , DoneFlags