% % scan xact folders for n-digit match at end of xact number % % stack: xact-search-digits % !Search.Page _Search.Page negative { 11 *cusvsorc *cusvplst /* 0 !counter %%% 0 !Xact snap "xact*" { % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard % 2 copy xactseed % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard % snap-dir wildcard xact-seed (empty to start) % "seed" log)( File.FoldPrev % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard new-pathed-seed % isnull ? "newfold" log)( +counter 10 gt ? % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard new-seed % "\xact" right$ !Xact "incoming.txt" ofxact exists { _Xact !Cust.Xact xactinfo *xactmmtx third *cusvsubt % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed xlist-ctr % 6 -1 roll ^ 5 1 roll } { } ifelse % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed % } loop % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed new-pathed-seed % 3 popoff % % Xact is set to the matched xact number or the last Xact in Snap % "ctr" log)( *cusvsore *cusvseek _Xact positive { *custsvop *custsawu } { } ifelse */ } { 11 *cusvsorc *cusvslst /* 0 !counter %%% 0 !Xact snap "xact*" { % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard % 2 copy xactseed % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard % snap-dir wildcard xact-seed (empty to start) % "seed" log)( File.FoldNext % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard new-pathed-seed % isnull ? "newfold" log)( +counter 10 gt ? % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard new-seed % "\xact" right$ !Xact "incoming.txt" ofxact exists { _Xact !Cust.Xact xactinfo *xactmmtx third *cusvsubt % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed xlist-ctr % 6 -1 roll ^ 5 1 roll } { } ifelse % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed % } loop % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed new-pathed-seed % 3 popoff % % Xact is set to the matched xact number or the last Xact in Snap % "ctr" log)( *cusvsore _Xact "upwards" log)( positive { *custsvop *custsawu } { } ifelse %%% *cusvseek */ 11 *cusvsorc *cusvplst /* 0 !counter %%% 0 !Xact snap "xact*" { % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard % 2 copy xactseed % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard % snap-dir wildcard xact-seed (empty to start) % "seed" log)( File.FoldPrev % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard new-pathed-seed % isnull ? "newfold" log)( +counter 10 gt ? % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard new-seed % "\xact" right$ !Xact _counter 1 eq { *custsvop *custsawu } if "incoming.txt" ofxact exists { _Xact !Cust.Xact xactinfo *xactmmtx third *cusvsubt % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed xlist-ctr % 6 -1 roll ^ 5 1 roll } { } ifelse % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed % } loop % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed new-pathed-seed % 3 popoff % % Xact is set to the matched xact number or the last Xact in Snap % "ctr" log)( *cusvsore */ /* _Xact positive { *custsvop *custsawu } { } ifelse */ /* *cusvseek */ } ifelse