How to make an app - Andromo App Maker

Announcement

Collapse
No announcement yet.

Remove multiple items from a Listbox

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remove multiple items from a Listbox

    As straightforward as this task might seem, I actually had a devil of a time trying to figure it out. Have in the past, been coding this one via a simple table iteration, not realizing that it was in fact deleting the wrong items from the Listbox. Could not for the life of me, work out why?

    And then finally realized, it just needed a do/while count-loop instead (Example attached).
    D'oh! Don't ya just love missing the obvious?
    Attached Files

  • #2
    Finding the simple and the obvious solution is more complicated sometimes than the complicated solution , i think i had just complicated my sentence.

    Good you solved it as usual , keep forward

    Comment


    • #3
      Additionally, you could also use a for loop, which is cleaner in my honest opinion
      Code:
      local tSelected = ListBox.GetSelected("ListBox1"); -- gets selected indexes from the ListBox, and stores in table
      if tSelected then -- ensures something is selected
          -- from the # of items in tSelected to 1, step -1 do
          for i = #tSelected, 1, -1 do 
              ListBox.DeleteItem("ListBox1", tSelected[i]);
          end 
      end
      Bas Groothedde
      Imagine Programming :: Blog

      AMS8 Plugins
      IMXLH Compiler

      Comment


      • #4
        Hello Bio and IP.. thanks for all your ideas...

        Comment


        • #5
          Originally posted by Imagine Programming View Post
          Code:
          for i = #tSelected, 1, -1 do
          I so like it when you drop by, IP.
          My man!



          Comment


          • #6
            Originally posted by BioHazard View Post
            I so like it when you drop by, IP.
            My man!


            I still linger these forums every single day, I can't seem to stay away!
            Bas Groothedde
            Imagine Programming :: Blog

            AMS8 Plugins
            IMXLH Compiler

            Comment


            • #7
              Originally posted by Imagine Programming View Post

              I still linger these forums every single day, I can't seem to stay away!
              i am not here every day but I come back at lest once a week, the place we used to have might be gone but I know I enjoyed it and maybe one day these new little devs will bring it back.
              Plugins or Sources MokoX

              Comment


              • #8
                Originally posted by kingzooly View Post
                ...the place we used to have might be gone but I know I enjoyed it ...
                Hey, Rexxy - you're back! Was starting to worry we'd lost you over to the dark side. I agree, circa 2009-2011 was a fun time when this board was always lit up with both great chatter and great code.

                And now, so many have gone MIA: Rizla, reteset, Sakuya, Centauri Soldier, T3STY, Worm - the list goes on. And is passed time a rescue mission was mounted for our missing brothers - is not quite the same without them!

                But after 'arising from the dead' so to speak, I have to say, I'm very happy to see both you and IP are still here after all these years. Here's to the both of ya', my brothers!



                Comment


                • #9
                  Originally posted by BioHazard View Post
                  But after 'arising from the dead' so to speak, I have to say, I'm very happy to see both you and IP are still here after all these years. Here's to the both of ya', my brothers!


                  I guess this is a nostalgic place for me haha!
                  Bas Groothedde
                  Imagine Programming :: Blog

                  AMS8 Plugins
                  IMXLH Compiler

                  Comment


                  • #10
                    This is a nostalgic place for myself, I have moved on slowly to FiveM and other Lua or php project, and the Dark Side is not far of the truth I have been researching much more about private and off the record and de-centralised systems, tor being one of they ways to help do this, sadly my research is slow and I am dumb as two thick planks but hey I try lol

                    I still work in AMS almost every day tho, I love tweaking my old tools with new idea I want to make a tool what would connect via tor but still no luck, the older two tools like wget no longer work or using versions of tor so unsafe it's not fun, and there is NO way I would ever include the full tor bundle myself lol

                    I am a tinker these days.
                    Plugins or Sources MokoX

                    Comment


                    • #11
                      Yes, a few of us are still around... pushing boundaries, or at least trying new ideas.
                      Classic IT Support
                      www.classic-it.net
                      www.message7.org

                      Comment

                      Working...
                      X