| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
QuickList.SubList
Returns a part of the list.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| List | 7.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "QuickList.SubList"; ListRef; Index; Count { ; ReturnNewList; NoReturnEnding } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| ListRef | The reference to the list returned from QuickList.New function. | $List | |
| Index | The zero based index where to start. Or in other words: How many entries to skip. |
3 | |
| Count | How many entries to copy. If negative, we pick the other items left. |
5 | |
| ReturnNewList | Pass 1 to return result as new QuickList. This new list must be freed later using QuickList.Release function. Pass 0 (Default) to return a text list. |
0 | Optional |
| NoReturnEnding | If you passed 0 for ReturnNewList, decides about new list: Pass 1 to have no extra newline character on the end of the returned list. Default is 0 to include one to easily concat lists. |
1 | Optional |
Result
Returns OK or error.
Description
Returns a part of the list.Can return new QuickList or normal list.
Examples
Get a page of entries from a QuickList:
# list with many entries, e.g. from a SQL query
Set Variable [ $list ; Value: MBS( "QuickList.New"; "1¶2¶3¶4¶5¶6¶7¶8¶9¶10" ) ]
# skip 3 entries, take 4 as text list without return at the end
Set Variable [ $page ; Value: MBS( "QuickList.SubList"; $list; 3; 4; 0; 1 ) ]
Set Variable [ $r ; Value: MBS( "QuickList.Release"; $list ) ]
Example result: 4¶5¶6¶7
Set Variable [ $list ; Value: MBS( "QuickList.New"; "1¶2¶3¶4¶5¶6¶7¶8¶9¶10" ) ]
# skip 3 entries, take 4 as text list without return at the end
Set Variable [ $page ; Value: MBS( "QuickList.SubList"; $list; 3; 4; 0; 1 ) ]
Set Variable [ $r ; Value: MBS( "QuickList.Release"; $list ) ]
Example result: 4¶5¶6¶7
See also
- List.SubList
- QuickList.AddList
- QuickList.GetList
- QuickList.List
- QuickList.New
- QuickList.PopFirst
- QuickList.Release
- QuickList.SetList
Release notes
- Version 7.5
- Added List.SubList and QuickList.SubList functions.
Blog Entries
This function checks for a license.
Created 27th September 2017, last changed 6th November 2026
MarkDown version: QuickListSubList.md