t is an array index that points to the next available record in lists; it must be preserued between calls to avail

static int t=0;

t++;

return(t);