list_refcnt

Returns the number of references to the list.

Available in:

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

Syntax

int list_refcnt(list-name)
list            list-name

Description

Returns the number of references to the list.

Example

Check for multiply referenced lists:
#trigger list_check
{
int i;
list_seek(parm.0,0);
while (true) {
  for (i=0;i<list_cols(parm.0);i++) {
    if (datatype(list_curr(parm.0,i)) == "L") {
      if (list_curr(parm.0,i) != NULL &&
          list_refcnt(list_curr(parm.0,i)) > 1)
        prompt("List: "^^parm.1^^", row: "^^list_pos(parm.0)^^
               "col: "^^i^^", the list item has refcnt > 1");
      list_check(list_curr(parm.0,i),list_pos(parm.0)^^":"^^i);
      }
    }
  if (list_pos(parm.0) == list_next(parm.0)) break;
  }
}