Action
Returns a random item from a list.
Syntax
aElem = RandPick(lList)
Variable
|
Description
|
aElem
|
A random item from the list.
ANYTYPE.
|
laList
|
The list to pick a random item from.
LIST OF ANYTYPE.
|
Notes
RandPick returns a random item from
laList. The item can have any data type.
Example
[-] testcase RandPickExample()
[ ] LIST OF STRING lsItems
[ ] STRING sRandomItem
[-] lsItems = {...}
[ ] "Clam Chowder"
[ ] "Fried Chicken"
[ ] "Lobster"
[ ] "Green Eggs and Ham"
[ ] sRandomItem = RandPick (lsItems)
[ ] Print("The special of the day is {sRandomItem}.")