Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  

List.CrossProduct

Creates the cross product from two lists.

Component Version macOS Windows Linux Server iOS SDK
List 6.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "List.CrossProduct"; List1; List2 { ; Prefix; Midfix; Postfix; Flags } )   More

Parameters

Parameter Description Example Flags
List1 The first list to process. "Hello¶World"
List2 The second list to process. "1¶2"
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 have no extra newline character on the end of the returned list. Default is 0 to include one to easily concat lists.
Add 2 for a diagonal cross, so we combine each element of first list with the same element index from the second list.
1 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

Test with all parameters:

MBS( "List.CrossProduct"; "Hello¶World"; "1¶2"; "before"; "middle"; "after" )

Combine elements from lists:

MBS( "List.CrossProduct"; "Hello¶World"; "1¶2"; "before"; "middle"; "after"; 2 )

Take two lists to fill two columns in a list dialog:

MBS("ListDialog.AddItemsToList"; MBS( "List.CrossProduct"; ListDialog::Text1; ListDialog::Text2; ""; Char(9); ""; 2))

See also

Blog Entries

Created 4th March 2016, last changed 10th December 2020


List.CountValuesMatching - List.DeCombine

Feedback: Report problem or ask question.