MergeLists()

语法

MergeLists(SourceList(), DestinationList() [, Location])
概要
Moves all elements from the SourceList() to the DestinationList(). This is a fast operation because the element data itself is not moved to merge the two lists.

参数

SourceList() The list from which the elements will be taken. This list will be empty after the function returns.
DestinationList() The list to move the elements to. This list will contain the items of both lists after the function returns.
Location (optional) Location where to insert the elements in the DestinationList(). This can be one of the following values:
  #PB_List_First : Insert the elements at the beginning of DestinationList()
  #PB_List_Last  : Append the elements at the end of DestinationList()
  #PB_List_Before: Insert the elements before the current element of DestinationList()
  #PB_List_After : Insert the elements after the current element of DestinationList()

返回值

无.

示例

  NewList A.s()
  AddElement(A()): A() = "a0"
  AddElement(A()): A() = "a1"
  AddElement(A()): A() = "a2"
  AddElement(A()): A() = "a3"
  
  NewList B.s()
  AddElement(B()): B() = "b0"
  AddElement(B()): B() = "b1"
  AddElement(B()): B() = "b2"
  AddElement(B()): B() = "b3"
    
  ; Insert the elements of A() before the "b1" element in B()
  SelectElement(B(), 1)
  MergeLists(A(), B(), #PB_List_Before)
  
  ForEach B()
    Debug B()
  Next

参阅

SplitList()

已支持操作系统

所有

<- ListSize() - List Index - MoveElement() ->