MaxStepCount

TradeDesign avoids endless loops by counting the internal OP-code execution after the last triggering event, thus until the system waits for the next user interaction. If this count exceeds a configurable threshold, TradeDesign interrupts the execution and queries the user whether the execution shall be terminated or continued. Without such a feature processes which entered into an endless loop can only be terminated by an external termination of the process.

The configurable threshold is taken by TradeDesign from an INI file entry. There is an additional possibility to temporarily reset the counter and to change the active threshold by programmed logic. This should only be done with care and normally be avoided.

In the DBITPD transaction - Administering System Parameters - there is a field 'Suspend execution after a maximum number of xxxxx steps' on the Debug panel. This is the maximum number of steps that can be executed before the system recognizes an infinite loop.

Any change has an effect on the whole system.

The number of steps can be increased/changed for individual modules using:

SetContext( tdContextMAXSTEPCOUNT, 50000000, TRUE )

In situations where large amounts of data are regularly processed, such as in reorganization programs, it makes sense to change the threshold. Here, the MaxStepCount needs to be increased and the Timeout function deactivated.

Following completion of any processing, the MaxStepCount should be reset to the old value using:

SetContext( tdContextMAXSTEPCOUNT, -1, TRUE )

Deactivate Timeout by using the following:

$TIMEOUT = GetContext( "TIMEOUT" ) 
SetContext( "TIMEOUT", "0" )

After processing reactivate Timeout using:

SetContext( "TIMEOUT", $TIMEOUT )