The MCVX_BACKTRACK DQF should hopefully satisfy most of the shortcomings of the link stepping logic but, when even that fails, the ultimate solution is the jump DQFs. These are JUMP, JUMP_TRUE, JUMP_FALSE and JUMP_UNDEFINED. Except for JUMP, these DQFs are supplied with a test and if the test condition is satisfied, jump to another part of the n-tuple entry and continue to fill it from there. JUMP jumps unconditionally. They are used as follows:-
' _ dqf_name relative_offset, ' ' test_value; 'where:-
Attempting to jump back before the first entry discards the current n-tuple, see section 6.7.2.
Forward jumps must be treated with caution, jumping over entries will leave them at their undefined entry, even if you have requested that partial entries are to be discarded.
Attempting to jump forward beyond the last entry signals that the current n-tuple is complete and is ready to be stored, see section 6.7.2
' _ gt ev, $KEV_NPM,60; ' ' - jump_true _big_event; '
It is recommended that, when using entries as labels for jumps they be reserved just for the purpose i.e. not used to store data. The following construction:-
' _my_label: 'is treated as shorthand for:-
' _my_label reserved; 'and helps to make labels stand out.
The primary use of the JUMP DQFs is to allow fine tuning of MCVX_BACKTRACK. For example, suppose you wish to backtrack from a scanned point MCVX to the first upstream interaction vertex which has its creation bit (KMCVX_CRE) set. This could be done as follows:-
' _my_vx get_link MCVX; ' ' _my_tk mcvx_backtrack _my_vx, $KMCVX_INT; ' ' _is_creation bits _my_vx, $KMCVX_CRE, 1; ' ' _ jump_false _my_tk, _is_creation; 'The first two lines define the link _my_vx to be equal to the scan point MCVX and then passes it to MCVX_BACKTRACK requiring that it backtracks to the first interaction that it encounters. On return _my_vx now points to the MCVX it has found. Next the BITS DQF is used to pull out the creation bit setting from its status word. Finally the JUMP_FALSE DQF is called using the setting of this bit. If it is zero i.e. false, the test succeeds, and the jump back to the _my_tk entry occurs. So MCVX_BACKTRACK is now called again and starts by stepping back one vertex, before resuming backtracking.
The simple loop illustrated above, allows you to add extra tests and to continue backtracking until they are all satisfied or until backtracking failed. It is worth spelling out what happens in this case. The first thing that happens is the MCVX_BACKTRACK returns a link of 0 which is equivalent to saying the result is undefined. If the discard partial entry is set on, then collection terminates at this point. If not the code ploughs on to the BITS DQF. As the link is zero, the result _is_creation is given the undefined value. This value is not considered to be false so the subsequent jump does not occur and so the loop breaks and control passes to the next entry word in the n-tuple.