Enigma 78 Posted June 18, 2011 Report Share Posted June 18, 2011 Is there a way to $set list position by for instance a #variable or an item in the list? So if you have a list containing the following: applespearsorangesbananapeaches So for instance "oranges".Then i want to $set list position => oranges instead of $set list position => "3" Reason is that the list is "dynamic" so i want to start from a list but i do not know the content of the list, but i do know the itemname, which is anywhere in the list (can be from line 0 to 100000000000000). Also, is there a way to set an end position?Same thing, but now i want to set a list position that it stops the current task.Kinda "$set end position", so as soon as that item (or #variable) is reached the script stops or move on to the next task. Quote Link to post Share on other sites
Praney Behl 314 Posted June 18, 2011 Report Share Posted June 18, 2011 It quite easy.. Loop it to the item and set that as list position.. Quote Link to post Share on other sites
Enigma 78 Posted June 18, 2011 Author Report Share Posted June 18, 2011 It quite easy.. Loop it to the item and set that as list position.. Can you make an example?I don't understand what you mean. Quote Link to post Share on other sites
Praney Behl 314 Posted June 18, 2011 Report Share Posted June 18, 2011 There you go: add to list(fruits); Set $pos = 0; while(not($listitem($pos)=="oranges")) { inc($pos); } Set $listpostion = $pos; { Do something..... ..... ..... } Quote Link to post Share on other sites
Enigma 78 Posted June 19, 2011 Author Report Share Posted June 19, 2011 There you go: add to list(fruits); Set $pos = 0; while(not($listitem($pos)=="oranges")) { inc($pos); } Set $listpostion = $pos; { Do something..... ..... ..... } Thanks Praney, will check this tomorrow on my bot. Quote Link to post Share on other sites
Praney Behl 314 Posted June 20, 2011 Report Share Posted June 20, 2011 Thanks Praney, will check this tomorrow on my bot. No worries mate, let us know if you have any dramas. 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.