gfpoow 0 Posted February 4, 2012 Report Share Posted February 4, 2012 i have a list (%list1) like below:aaabbbcccdddeeefffggghhhiiijjj i want to change value of all even rows to zzzhow to do that? Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 4, 2012 Report Share Posted February 4, 2012 divide the list position by 2, and if contains a . then do nothing else change it. a even number will always be divisible by 2 evenly. where as a odd number will not. Quote Link to post Share on other sites
gfpoow 0 Posted February 4, 2012 Author Report Share Posted February 4, 2012 using divider? i still confuse okay, more simple questionfrom list abovehow to change value in list position: 5 to 'zzz' ? thanks a lot Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 4, 2012 Report Share Posted February 4, 2012 You first asked how to change the position on all even numbered positions. Now your asking how to change the value of a specific positionsimply call the position number and change it. What is the purpose, rhyme or reason for what your wanting to do and an exact formula and example could be put together. and please use a real live example. Fake manipulated examples most times lead to misconception and wrong results. Quote Link to post Share on other sites
gfpoow 0 Posted February 4, 2012 Author Report Share Posted February 4, 2012 simply call the position number and change it. how to do that?i can call the list postion number but i can't change the value of thatplease gimme the example to do that thanks again Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 4, 2012 Report Share Posted February 4, 2012 how to do that?i can call the list postion number but i can't change the value of thatplease gimme the example to do that thanks again Here is the code exampleclear list(%random text) add list to list(%random text, $list from text("aaa bbb ccc ddd eee fff ggg hhh iii jjj", $new line), "Delete", "Global") set(#row, 0, "Global") loop($list total(%random text)) { if($comparison($list item(%random text, #row), "=", "fff")) { then { load html(#row) } else { } } increment(#row) } Video demonstration and how to put it together.http://screencast.com/t/Xs7cZiI7 Quote Link to post Share on other sites
gfpoow 0 Posted February 4, 2012 Author Report Share Posted February 4, 2012 thanks for your help LoWrIdErTJbut it still not solve my problem i don't want to load html(#row)but i want to change value of the list in specific position in this example i want change fff to zzzso when i check in debugger the list will beaaabbbcccdddeeezzzggghhhiiijjj Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 4, 2012 Report Share Posted February 4, 2012 I think your confused what you want to do, and therefore wasting time on getting you the exact answer your looking for. You first wanted to change an item then you asked how to get the list position.I gave you an example how to get that list position. Now stead of load html to bring back the list position. in that loop you can add each item to a new list, and if item = what your looking for then add something else Example: clear list(%random text) clear list(%new list) add list to list(%random text, $list from text("aaa bbb ccc ddd eee fff ggg hhh iii jjj", $new line), "Delete", "Global") set(#row, 0, "Global") loop($list total(%random text)) { if($comparison($list item(%random text, #row), "=", "fff")) { then { add item to list(%new list, "text here to replace with", "Delete", "Global") } else { add item to list(%new list, $list item(%random text, #row), "Delete", "Global") } } increment(#row) } Quote Link to post Share on other sites
gfpoow 0 Posted February 4, 2012 Author Report Share Posted February 4, 2012 Finally, Thanks a lot LoWrIdErTJthat's all i wantedit seems you are the most active user in this forum simply call the position number and change it. in post #5 i mean how to change valuenot to call the positionsorry for the misunderstanding thanks again 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.