$list position

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
This command is similar to the list total command, except, instead of returning the  
 
This command is similar to the list total command, except, instead of returning the  
 
total for an entire list, it will return the list position of the current item. This function works  with the next list item function and the previous list item functions.
 
total for an entire list, it will return the list position of the current item. This function works  with the next list item function and the previous list item functions.
 +
 +
'''List:''' The desired populated list.
  
  

Revision as of 21:54, 26 April 2013

$list position is a Data Function. The function returns the position of a specific list item.

This command is similar to the list total command, except, instead of returning the total for an entire list, it will return the list position of the current item. This function works with the next list item function and the previous list item functions.

List: The desired populated list.


Example

One of the many to see the list position function at work is by displaying it. Adding the list position function into the alert command next to the next list item function brings up the list item and the list position of the list item. Notice that the next list item function and the list position function are separated by commas.

add list to list(%my list, $list from text("hello,hi,how are ya", ","), "Delete", "Global")
set list position(%my list, 0)
loop($list total(%my list)) {
    alert("{$next list item(%my list)},{$list position(%my list)}")
}

List item 1 at list position 1 File:Listposition.png

List item 2 at list position 2 File:Listposition1.png

List item 3 at list position 3 File:Listposition2.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox