CopyList()

Syntax

Result = CopyList(SourceList(), DestinationList())
Description
Copy every elements of 'SourceList()' into 'DestinationList()'. If the two lists are not of the same type (native or structured) the copy will fail and 'Result' will be 0. Every elements previously found in 'DestinationList()' will be deleted. After a successful copy, the two lists are identicals.

Example:

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

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

Supported OS

All

<- ClearList() - LinkedList Index - DeleteElement() ->