CopyList()

Syntax

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

Parameters

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.

Return value

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

Example

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

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

See Also

CopyArray(), CopyMap()

Supported OS

All

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