%%% 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)( % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard new-seed % "\xact" right$ !Xact % % check for search term match % _Search.Term % % the duplicate item keeps the stack balance on exit % dup length _Xact exch right eq$ { % % stack: xlist-pre xlist-post xlist-ctr snap-dir wildcard search-term % "incoming.txt" ofxact exists { _Xact !Cust.Xact *xactninf *xactmmtx 3 index *cusvsubt % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed search-term xlist-ctr % 7 -1 roll ^ 6 1 roll } { } ifelse } { } ifelse % % stack: xlist-pre xlist-post xlist-ctr tack-dir seed search-term % pop } 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