Copies one list into another.


GML Code Example

ds_list_copy( id, source );

Argument Description
id The id of the list being copied to.
source The id of the list to be copied from.

Returns: N/A


With this function you can copy the contents of one list into another. Both lists must have been created previously and if the list being copied to already has information within it, this list will be cleared first. The end result is two independent lists which contain the same information.


GML Code Example

if !ds_list_empty(main_list)
    old_list = ds_list_create();
    ds_list_copy(old_list, main_list);

The above code will check a ds_list to see if it is empty. If it is not empty it is copied into another ds_list (which has been created previously) and then the original list is cleared.

Back: DS Lists

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here