list_close

Closes a list.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

list list_close(list-name)
list            list-name

Description

Decrements the list's reference count. If the reference count is 0 and list_close() is not in an expression, the list and all of its resources, such as memory, are released. If the function is part of an expression, the list is not freed even if the reference count is 0. The reference count of a list is also decremented whenever a new value is assigned to it. Thus list_close(list-name) is equivalent to list-name = NULL.

Example

Assigns a list from one variable to another without creating a new list reference.
WL = list_close(LL);
WL = list_close(get_list());
Where get_list() is a user function that returns a list. Returns a list from a user function without creating a new list reference.
{
list LL;
LL = list_open("SELECT name,id FROM staff",1000);
return(list_close(LL));
}
Closes and drops a list.
{
list LL;
LL = list_open("SELECT name,id FROM staff",1000);
list_view(LL,0);
list_close(LL);
}