Detect when a variable counts up

Hi,
Wonder if anyone could give me a hint of how to detect when a variable counts up. I’m having a database table and for every new row the index counts up. I want to use this index as the variable and when it counts up one number I want to start some logiks in my strategy.
Thanks in advance!

I solved the problem with this script:

ftLog_Index_Gu1 [0] = n_Index_Gu1;

delaysec (1);
fVal_1 = ftLog_Index_Gu1 [0] - ftLog_Index_Gu1 [1];

delaysec (1);
ftLog_Index_Gu1 [1] = n_Index_Gu1;

If (ftLog_Index_Gu1[0] == ftLog_Index_Gu1[1]) then
SetVariableTrue(b_Q1);
Else
SetVariableFalse(b_Q1);
Endif