Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

QuickList.Shuffle

Shuffles the items in the list.

Component Version macOS Windows Linux Server iOS SDK
List 14.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "QuickList.Shuffle"; List { ; ReturnNewList } )   More

Parameters

Parameter Description Example Flags
List The list to work on. $List
ReturnNewList Pass 1 to return result as new QuickList.
This new list must be freed later using QuickList.Release function.
Pass 0 (Default) to modify the list in the List1 parameter.
0 Optional

Result

Returns list, OK or error.

Description

Shuffles the items in the list.
We use random number generator to swap items randomly and change the list.

Examples

Try shuffle:

Set Variable [ $listRef ; Value: MBS("QuickList.New"; "a¶b¶c¶d¶e¶f") ]
#
Set Variable [ $r ; Value: MBS("QuickList.Shuffle"; $listRef) ]
Set Variable [ $list ; Value: MBS("QuickList.GetList"; $listRef) ]
Show Custom Dialog [ "list shuffled" ; $list ]
#
Set Variable [ $r ; Value: MBS("QuickList.Shuffle"; $listRef) ]
Set Variable [ $list ; Value: MBS("QuickList.GetList"; $listRef) ]
Show Custom Dialog [ "list shuffled" ; $list ]
#
Set Variable [ $r ; Value: MBS("QuickList.Release"; $listRef) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 8th November 2023, last changed 14th December 2023


QuickList.SetValue - QuickList.Sort