Jump to content
UBot Underground

store current list item into a variable


Recommended Posts

If you are trying to store all the items then in the last node of the image you should have the selected list instead of #current_item variable.

 

But if you are trying to save the whole list in a variable then you have to :

 

set "variable_name";

inserts -> insert list -> list_name;

 

That may help..

 

Praney

Link to post
Share on other sites

thank you guys :)

 

@Praney : i am trying to save the current/active item during the loop, not the whole list

 

@irobot : #current_item starts with the second list item with $next_list_item

 

 

#current_item starts stores the second list item as first item because $next_list_item is already begin used once in the loop?

 

can i do something like $next_list_item minus 1?

 

Set variable 
Variable: #current_item
Content: $next list item (minus 1)

Link to post
Share on other sites

 

#current_item starts stores ;) the second list item as first item because $next_list_item is already begin used once in the loop?

Use the set variable just after the $list total, so that the variable #current_item can be used in both places.

Link to post
Share on other sites

I would solve this by using the set command outside the loop as such:

 

Set #listposition = 0

 

Instead of using $Next List Item I would use $List Item with the position set to #listposition.

 

At the end of your loop (inside the loop) use inc--->#listposition

 

What it all means is your #listposition variable increments by one with every cycle of the loop.

 

Under this format, it will grab position 0 as well. HTH.

 

John

  • Like 1
Link to post
Share on other sites
#current_item starts stores the second list item as first item because $next_list_item is already begin used once in the loop?

 

The reason why your items were one digit off is because list ITEM #s start at 0, while list POSITIONS start at 1.

 

1. [0] First

2. [1] Second

3. [2] Third

 

To store the VALUE of the current POSITION you have to take an ITEM that's one LESS than the current POSITION number:

http://imgur.com/OcNEt.jpg

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...