$random list item
From UBot Studio
(Difference between revisions)
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
$random list item is a [[Data Functions|Data Function]]. This function will return a random list item from a specified list each time it is run. | $random list item is a [[Data Functions|Data Function]]. This function will return a random list item from a specified list each time it is run. | ||
− | + | '''List:''' The desired populated list where the random list item will be pulled from. | |
== Example == | == Example == | ||
Line 15: | Line 15: | ||
The random list item function will allow to [[Alert|alert command]] from the [[Flow Commands|flow commands]] to pop up with a new list item each time a cycle is run in the loop. | The random list item function will allow to [[Alert|alert command]] from the [[Flow Commands|flow commands]] to pop up with a new list item each time a cycle is run in the loop. | ||
− | [[File: | + | |
+ | [[File:p0p0.jpg]] | ||
+ | |||
On the first run, the [[Alert|alert command]] returns list item 5. | On the first run, the [[Alert|alert command]] returns list item 5. |
Latest revision as of 17:22, 27 December 2016
$random list item is a Data Function. This function will return a random list item from a specified list each time it is run.
List: The desired populated list where the random list item will be pulled from.
[edit] Example
add list to list(%my list, $list from text("list item 1, list item 2,list item 3, list item 4,list item 5,list item 6", ","), "Delete", "Global") set list position(%my list, 0) loop($list total(%my list)) { alert($random list item(%my list)) }
The random list item function will allow to alert command from the flow commands to pop up with a new list item each time a cycle is run in the loop.
On the first run, the alert command returns list item 5.