QuickList.Reserve
-----------------

Reserves memory for a list of given size.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [List](component_List.md) | [4.4](newinversion44.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "QuickList.Reserve"; ListRef; Size ) 

**MBS**( **"QuickList.Reserve"** /\* Reserves memory for a list of given size. \*/  
**$ListRef**; /\* The reference to the list returned from [QuickList.New](QuickListNew.md) function. e.g. $List \*/   
**$Size**) /\* The new size in entries.  
So passing 100 will make sure we have space for 100 list entries at least. If more are added, the list grows automatically. e.g. 100 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ListRef | The reference to the list returned from [QuickList.New](QuickListNew.md) function. | $List |
| Size | The new size in entries.   So passing 100 will make sure we have space for 100 list entries at least. If more are added, the list grows automatically. | 100 |

### Result

Returns OK or error.

### Description

Reserves memory for a list of given size.  
To ensure upfront that enough memory is available.  
This will not change the count, just preallocate memory.  
### Examples

Reserve memory before adding many values:

 Set Variable \[ $list ; Value: MBS ( "[QuickList.New](QuickListNew.md)" ) \]  
\# we will add 10000 values, so reserve the space once   
Set Variable \[ $r ; Value: MBS ( "QuickList.Reserve"; $list ; 10000 ) \]  
Set Variable \[ $i ; Value: 1 \]  
Loop  
 Set Variable \[ $r ; Value: MBS ( "[QuickList.AddValue](QuickListAddValue.md)"; $list ; "Item " &amp; $i ) \]  
 Set Variable \[ $i ; Value: $i + 1 \]  
 Exit Loop If \[ $i &gt; 10000 \]  
End Loop  
Set Variable \[ $r ; Value: MBS ( "[QuickList.Release](QuickListRelease.md)"; $list ) \]  
### See also

- [List.AddValue](ListAddValue.md)
- [QuickList.AddValue](QuickListAddValue.md)
- [QuickList.New](QuickListNew.md)
- [QuickList.Release](QuickListRelease.md)
- [QuickList.Remove](QuickListRemove.md)
- [QuickList.Reverse](QuickListReverse.md)

### Blog Entries

- [Data structures in FileMaker with MBS Plugins](https://www.mbsplugins.de/archive/2017-10-19/Data_structures_in_FileMaker_w/monkeybreadsoftware_blog_filemaker)
- [Quicklist - Fast lists for FileMaker](https://www.mbsplugins.de/archive/2014-09-29/Quicklist_-_Fast_lists_for_Fil/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2015, Seite 19](https://filemaker-magazin.de/neuigkeit/3785-Appetithappen-FMM_201501)

This function checks for a license.

Created 21st September 2014 , last changed 6th November 2026

  
[QuickList.RemoveValues](QuickListRemoveValues.md) - [QuickList.Reverse](QuickListReverse.md)

[HTML Version](QuickListReserve.shtml)