Jump to content
UBot Underground

Are these statements valid for detecting end of a list?


Recommended Posts

if($comparison($list position(%testList), "=", $list total(%testList))) {
    then {
        set list position(%testList, 0)

-----------


if($comparison($list position(%testList), ">=", $list total(%testList))) {
    then {
        set list position(%testList, 0)

 

 

 

Thanks.

Link to post
Share on other sites

I am sorry . I'm  just a dumb  newbie here. I would really appreciate it  if you could explain how and why this works...?]

do you mean -  list position+1 > list total?

I find that at end of a list ->  list position = list total

That is why I had enquired about the above statements in the OP.

In this case if list total = say 10, then, when end of list is reached - list pos. would also = 10.

hence,in your code   - we are checking 10+1 > 10?

In the same vein I had also thought of checking - if list position = list total?

 

Thanks

Edited by Sanjeev
Link to post
Share on other sites

This gives you a better full example

 

clear list(%list)
add list to list(%list, $list from text("link
link0
link2
link3", $new line), "Delete", "Global")
loop(1000000) {
    if($comparison($add($list position(%list), 1), ">", $list total(%list))) {
        then {
            set list position(%list, 0)
        }
        else {
        }
    }
    navigate($next list item(%list), "Wait")
}

 

 

this is only reliant if your looping over a list a number of times larger then list total.

 

Otherwise there is no reason to set the list position back to 0

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...