< Back

Document Subject: Joining Lists Problem
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#ArrayJoin or http://A555F9/nn.nsf/ByAlias/ArrayJoin

When joining lists together with + the longest list will define the number of elements in the list. This is a feature of @formula pairwise operators. This can be powerful but can also be tricky to debug.




To demonstrate this put this code in a button:

list1:="a":"b":"c":"d";
list2:="1":"2";
list3:= "x":"y":"z";

@prompt([okcanceledit];"title";"result";@implode(list1+list2+list3);"")

 

The result is :

a1x b2y c2z d2z

The last elements of the three lists are used to pad out the list results.

The 2 are guessed at.

The z is guessed at.

 

Look at permuted operators for even more interesting results:

Replace the prompt line with

@prompt([okcanceledit];"title"; "result"; @implode(list1*+list2*+list3);"")

in your button code.

the result is:

a1x a1y a1z a2x a2y a2z b1x b1y b1z b2x b2y b2z c1x c1y c1z c2x c2y c2z d1x d1y d1z d2x d2y d2z

Must be useful, sometimes difficult to think when to use it though.