QuickList.CrossProduct
----------------------

Creates the cross product from two lists.

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

MBS( "QuickList.CrossProduct"; List1; List2 { ; Prefix; Midfix; Postfix; Flags } ) 

**MBS**( **"QuickList.CrossProduct";** /\* Creates the cross product from two lists. \*/  
**$List1**; /\* The reference to the first quicklist. \*/   
**$List2**; /\* The reference to the second quicklist. \*/   
**$Prefix**; /\* Optional; The prefix to use \*/   
**$Midfix**; /\* Optional; The middle to use.  
This text is put between texts from both lists. \*/   
**$Postfix**; /\* Optional; The postfix to use \*/   
**$Flags**) /\* 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.  
Add 2 for a diagonal cross, so we combine each element of first list with the same element index from the second list.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| List1 | The reference to the first quicklist. | $List1 |  |
| List2 | The reference to the second quicklist. | $List2 |  |
| Prefix | The prefix to use |  | Optional |
| Midfix | The middle to use.   This text is put between texts from both lists. |  | Optional |
| Postfix | The postfix to use |  | Optional |
| Flags | 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.   Add 2 for a diagonal cross, so we combine each element of first list with the same element index from the second list. | 0 | Optional |

### Result

Returns list or error.

### Description

Creates the cross product from two lists.  
Optionally adds prefix, postfix and midfix.  
Returns empty list if one of the lists are empty!  
### Examples

Try in a Let statement:

 Let(\[  
list1 = MBS ("[QuickList.New](QuickListNew.md)"; "Hello¶World");  
list2 = MBS ("[QuickList.New](QuickListNew.md)"; "1¶2");  
e = MBS ("QuickList.CrossProduct"; list1; list2);  
r = MBS ("[QuickList.GetList](QuickListGetList.md)"; list1);  
d = MBS ("[QuickList.Release](QuickListRelease.md)"; list1);  
d = MBS ("[QuickList.Release](QuickListRelease.md)"; list2)  
\]; r)  
### See also

- [List.CrossProduct](ListCrossProduct.md)
- [QuickList.GetList](QuickListGetList.md)
- [QuickList.New](QuickListNew.md)
- [QuickList.Release](QuickListRelease.md)

### Blog Entries

- [MBS FileMaker Plugin, version 6.1pr5](https://www.mbsplugins.de/archive/2016-03-06/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)
- [Evaluate vs. Script Trigger](https://www.mbsplugins.de/archive/2016-03-04/Evaluate_vs_Script_Trigger/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 4th March 2016 , last changed 14th December 2023

  
[QuickList.CountValuesMatching](QuickListCountValuesMatching.md) - [QuickList.DeCombine](QuickListDeCombine.md)

[HTML Version](QuickListCrossProduct.shtml)