CopyList()

语法

Result = CopyList(SourceList(), DestinationList())
概要
Copy the contents of one list to another list. After a successful copy, the two lists are identical.

参数

SourceList() The list from which the elements will be copied.
DestinationList() The list to which the elements will be copied. The elements in this list before the copy will be deleted. If this list does not have the same type (native or structured) as the SourceList() then the copy will fail.

返回值

Returns non-zero if the copy succeeded and zero otherwise.

示例

  NewList Friends$()
  NewList FriendsCopy$()
  
  AddElement(Friends$())
  Friends$() = "John"
  
  AddElement(Friends$())
  Friends$() = "Elise"

  CopyList(Friends$(), FriendsCopy$())
  
  ForEach FriendsCopy$()
    Debug FriendsCopy$()
  Next

参阅

CopyArray(), CopyMap()

已支持操作系统

所有

<- ClearList() - List Index - CountList() ->