QuickList.And
-------------

Returns a list with values which are contained in both lists.

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

MBS( "QuickList.And"; List1; List2 { ; ReturnNewList } ) 

**MBS**( **"QuickList.And";** /\* Returns a list with values which are contained in both lists. \*/  
**$List1**; /\* The reference to the first quicklist. \*/   
**$List2**; /\* The reference to the second quicklist. \*/   
**$ReturnNewList**) /\* Optional; Pass 1 to return result as new QuickList.   
This new list must be freed later using [QuickList.Release](QuickListRelease.md) function. Pass 0 (Default) to modify the list in the List1 parameter.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| List1 | The reference to the first quicklist. | $List1 |  |
| List2 | The reference to the second quicklist. | $List2 |  |
| ReturnNewList | Pass 1 to return result as new QuickList.    This new list must be freed later using [QuickList.Release](QuickListRelease.md) function. Pass 0 (Default) to modify the list in the List1 parameter. | 0 | Optional |

### Result

Returns list, OK or error.

### Description

Returns a list with values which are contained in both lists.  
Performs a logical AND operation.  
  
This function is made for lists without duplicate values as it checks if values from one list exists in others, which may not work correctly if one list has duplicate values.  
### Examples

Performs And on two quicklists:

 $list1 = MBS ( "[QuickList.New](QuickListNew.md)"; "a¶b¶c¶d")  
$list2 = MBS ( "[QuickList.New](QuickListNew.md)"; "a¶d")  
$list3 = MBS ( "QuickList.And"; $list1 ; $list2 ; 1 )  
$list = MBS ( "[QuickList.GetList](QuickListGetList.md)"; $list3 )  
$r = MBS ("[QuickList.Release](QuickListRelease.md)"; $list1 )  
$r = MBS ("[QuickList.Release](QuickListRelease.md)"; $list2 )  
$r = MBS ("[QuickList.Release](QuickListRelease.md)"; $list3 )  
### See also

- [List.And](ListAnd.md)
- [QuickList.AndColumn](QuickListAndColumn.md)
- [QuickList.Find](QuickListFind.md)
- [QuickList.GetList](QuickListGetList.md)
- [QuickList.New](QuickListNew.md)
- [QuickList.Not](QuickListNot.md)
- [QuickList.Or](QuickListOr.md)
- [QuickList.Pop](QuickListPop.md)
- [QuickList.Release](QuickListRelease.md)
- [QuickList.XOr](QuickListXOr.md)

### Release notes

- **Version 10.0**
    - Added [QuickList.AndColumn](https://www.mbsplugins.eu/QuickListAndColumn.shtml), [QuickList.NotColumn](https://www.mbsplugins.eu/QuickListNotColumn.shtml), [QuickList.OrColumn](https://www.mbsplugins.eu/QuickListOrColumn.shtml), and [QuickList.XOrColumn](https://www.mbsplugins.eu/QuickListXOrColumn.shtml) functions.

### Blog Entries

- [MBS Filemaker Plugin, version 4.4pr5](https://www.mbsplugins.de/archive/2014-10-12/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 8th October 2014 , last changed 20th December 2023

  
[QuickList.AddValue](QuickListAddValue.md) - [QuickList.AndColumn](QuickListAndColumn.md)

[HTML Version](QuickListAnd.shtml)