variable:n=0;
if date<>ref(date,1) then n:=0;
if 條件a then n:=n+1;
cc:valuewhen(ref(n=0,1) and n=1,close);