Note, use of <SkipDisplay> in a last frame item prior to version 18.104.22.168 of DMDX would result in the job being aborted and any data not being saved. This has now been rectified.
Also note that unless preservevm has been used between item files DMDX is going to shut the screen down and some displays will either flick back to the desktop or the DMDX dialog display momentarily, not much we can do about that (assuming preservevm is out of consideration of course). But some other displays switch back to a previous item's display and here we can actually do something. Putting an <EraseAll> in the last frame will clear all the back buffers (that have previous item's displays still in them) and fixes the problem because even if the video drivers display another buffer at least it will be blank (or the last item's display).
See <loadcounters> for details on setting up a re-entrant item file using <chain> .
Note that the Syntax check can be a bit freaky when chaining item files as it doesn't stop at <lastframe> items, it continues to the actual end of the item file before then chaining to whatever the last chain specified (meaning if you've got more than one possible chained item file things will not be proceeding as one might expect). On top of that if your item file sequence chains back to a previous item file infinite loops are squarely in play. I tend to use Diagnostic runs instead and I also tend to use Diagnostic Branching as well as any time I'm using more than a simple chain of item files (ones that start with one item file and the proceed linearly through a given sequence with no repeated files) I'm usually also branching like a SOB and in the Introduction (the absolute mother of all chained item files) I even go to the bother of detecting when a diagnostic run is in place and use macros to not ask to repeat a given section as in a diagnostic run the RT is always going to be positive and the value of the item's number. I do that by specifying a really low subject timeout and if I detect an RT above that I set a macro up to not ask questions otherwise it sets it up to ask questions:
+77 <t 10> <nfb> * <! detect diagnostic branching>;
~1 mb++ <bi 3, lastrt .EQ. 77>;
~1 mb+<bic -777>+ <! only offer repeat when not diagnostic>;
~3 <nfb 0> <t 4000>;
The introduction uses item 777 to mark the start of sections that can be repeated, later on at the end of those sections the items that would cause an infinite loop in diagnostic mode just use macro B that is either capable of branching back to the most recent item 777 or not:
+1 <nfb> "Would you like to repeat that sequence?"