Scripting Guide > Data Structures > Lists > Insert a Nested List in an Existing List
发布日期: 04/13/2021

Insert a Nested List in an Existing List

To insert a nested list in an existing list, specify the placement of the list as follows:

list2 = {{"a", "b"}, {"c", "d"}};
list2[3] = {"apple", "banana"}; // specify a list as the third item
Show( list2 );

list2 = {{"a", "b"}, {"c", "d"}, {"apple", "banana"}};

If you do not know the number of items in a list, use N Items(). In this example, an empty list is inserted at the end of the list.

list1 = {"a", "b"};
list1[N Items( list1 ) + 1] = {};
Show( list1 );

list1 = {"a", "b", {}};

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).