Brutal 164 Posted February 11, 2013 Report Share Posted February 11, 2013 I have a list... I want to remove a single word contained on one line of the list, and then close up the gap in the list it creates. MyList:(0) my;(1) cat;(2) is;(3) very;(4) cool; I want to remove "very" ... But I can't do it through list position because the position changes with each run. I have tried using remove/replace like it seems they would be used, but it throws an error. - I know this must be simple, but it's not letting me do it. Any help is greatly appreciated. Quote Link to post Share on other sites
gabel 51 Posted February 11, 2013 Report Share Posted February 11, 2013 something quick i came up with would be ui text box("Delete Word From List", #deleteword) add list to list(%test, $list from text("my cat is very cool", $new line), "Delete", "Global") set(#stopme, 0, "Global") set(#pos, 0, "Global") loop while($comparison(#stopme, "=", 0)) { if($comparison($list item(%test, #pos), "=", #deleteword)) { then { remove from list(%test, #pos) set(#stopme, 1, "Global") } else { increment(#pos) } } } This works if the word you're looking to remove shows up only once in the list . If it show more then once you need to mode the above code a bit Quote Link to post Share on other sites
Brutal 164 Posted February 12, 2013 Author Report Share Posted February 12, 2013 ha! - thanks guys ... I got it whipped into shape thanks to you. Quote Link to post Share on other sites
Monovski 4 Posted January 27, 2015 Report Share Posted January 27, 2015 how about if I need to remove words from the list that not contain spesific words? E.g 0. ubot1. ubot3. ubot4. tubo How remove tubo? I got stuck about it. Thanks Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.