list_same

Compares two list variables to determine if they point to the same list.

Available in:

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

Syntax

int list_same(list1,list2)
list          list1,list2

Description

Compares the two list variables and returns true if they point to the same list. This differs from simply using "==" with the list variables. The "==" operator returns true only if the list variables are pointing to the same row.

Example

{
list L1,L2;
L1 = list_open("SELECT * FROM staff",1000);
L2 = list_open("SELECT * FROM staff",1000);

printf(list_same(L1,L2));                   /* 0             */
if (L1 == L2) printf("L1 == L2");
else          printf("L1 != L2");           /* prints        */

L1 = L2
printf(list_same(L1,L2));                   /* 1             */
if (L1 == L2) printf("L1 == L2");           /* prints        */
else          printf("L1 != L2");

list_next(L1);
printf(list_same(L1,L2));                   /* 1             */
if (L1 == L2) printf("L1 == L2");
else          printf("L1 != L2");           /* prints        */
}