anchor.diff:  process_responses(_Fsm,[]) -> ok;
   process_responses(Fsm,[R|Responses]) ->
       case R of 
  -      #gres{loop=undefined} ->  ok;
  +      #gres{loop=undefined,rows=_Rows} ->  
  +         ok; %?Log("~p~n", [_Rows]);
         #gres{loop='>|...'} ->    ok;
         #gres{loop=Loop} ->
             timer:sleep(30),       
  
positive.code:                 );"
                  , 0, 'Imem', IsSec)),
  
          ?assertEqual(ok, insert_range(SKey, 11, def, 'Imem', IsSec)),
  
          Fsm = start(SKey,"fsm test",10,false,"select * from def;",self()),
          Fsm:?button('>'),
          receive_respond(Fsm),
          Fsm:?button('>'),
          receive_respond(Fsm),
          Fsm:?button('>'),
          receive_respond(Fsm),
          Fsm:?button('>>'),
          receive_respond(Fsm),
          Fsm:?button('>|...'),
          receive_respond(Fsm),
          Fsm:?button('<<'),
          receive_respond(Fsm),
          Fsm:?button('>|'),
          receive_respond(Fsm),
          Fsm:?button('<<'),
          receive_respond(Fsm),
          Fsm:?button('<<'),
          receive_respond(Fsm),
          Fsm:?button('<<'),
          receive_respond(Fsm),
          Fsm:?button('<<'),
          receive_respond(Fsm),
          Fsm:?button('<<'),
          receive_respond(Fsm),
          Fsm:?button('x'),
  
          ?assertEqual(ok, imem_sql:exec(SKey, "drop table def;", 0, 'Imem', IsSec)),
  
  
negative.code: -include("imem_seco.hrl").
  -include("imem_sql.hrl").
  
  -define(KeyMax,[]).     %% value bigger than any possible sort key {SortFun(Recs),Id}
  -define(KeyMin,{}).     %% value smaller than any possible sort key {SortFun(Recs),Id}
  
  -record(ctx,    { %% session context
                    skey
                  , id
                  , bl                  %% block length -> State
                  , stmtRef             %% statement reference
                  , isSec               %% secure mode or not
                  , rowFun              %% RowFun -> State
                  , sortFun             %% SortFun -> State
                  , sortSpec            %% SortSpec (based on statement full map)
                  , replyTo             %% reply pid
                  }).
  
  -record(state,  { %% fsm combined state
                    ctx                 %% statement & fetch context
                  , tableId             %% ets raw buffer table id 
                  , indexId             %% ets index table id 
                  , bl                  %% block_length (passed to init)
                  , gl                  %% gui max length (row count) = gui_max(#state.bl)
                  , stmtRef             %% statement reference
                  , rowFun              %% RowFun
                  , sortSpec            %% from imem statement, changed by gui events
                  , sortFun             %% from imem statement, follows sortSpec (calculated by imem statement)
                  , filterSpec = {}     %% {FType,[ColF|ColFs]}  changed by gui events FType= and|or  ColF = [{Col,["value1".."valuen"]}]
                  , filterFun           %% follows filterSpec
  
                  , rawCnt = 0          %% buffer row count
                  , rawTop = 99999999   %% id of top buffer row 
                  , rawBot = 0          %% id of bottom buffer row
                  , dirtyCnt = 0        %% count of dirty rows in buffer
                  , dirtyTop = 99999999 %% record id of first dirty row in buffer
                  , dirtyBot = 0        %% record id of last dirty row in buffer
  
                  , indCnt = 0          %% count of indexed buffer entries (after filtering) 
                  , indTop = []         %% smallest index after filtering, initialized to big value
                  , indBot = {}         %% biggest index after filtering, initialized to small value
  
                  , bufCnt = 0          %% buffer row count           (either rawCnt or indCnt, depending on nav)
                  , bufTop              %% id of top buffer row       (either rawTop or indTop, depending on nav)
                  , bufBot              %% id of bottom buffer row    (either rawBot or indBot, depending on nav)
  
                  , guiCnt = 0          %% count of scrollable entries in gui 
                  , guiTop              %% top gui pointer (Id for raw / SortKey for ind)
                  , guiBot              %% bottom gui pointer (Id for raw / SortKey for ind)
                  , guiCol = false      %% index collision (stale view in gui)
  
                  , nav = raw           %% navigation   raw | ind
                  , pfc=0               %% pending fetch count (in flight to DB or back)
                  , tailMode = false    %% tailMode scheduled
                  , stack = undefined   %% command stack {button,Button,ReplyTo}
                  , replyTo             %% reply pid
                  }).
  
  -record(gres,   { %% response sent back to gui
                    operation           %% rep (replace) | app (append) | prp (prepend) | nop | close
                  , cnt = 0             %% current buffer size (raw table or index table size)
                  , toolTip = ""        %% current buffer sizes RawCnt/IndCnt plus status information
                  , message = ""        %% error message
                  , beep = false        %% alert with a beep if true
                  , state = empty       %% determines color of buffer size indicator
                  , loop = undefined    %% gui should come back with this command
                  , rows = []           %% rows to show (append / prepend / merge)
                  , keep = 0            %% row count to be kept
                  }).
  
  -define(block_size,10).
  