C++
C#
VB
JScript
All

IDL Property IInterview­Info.­Max­Opcodes­Executed


Property MaxOpcodesExecuted As Long

The maximum number of opcodes that can be executed before the script is considered to be in an infinite loop.

Remarks

An interview script is internally broken down into a large number of simple instructions which are called opcodes. A single line of script might correspond to anything from one to hundreds of opcodes.

It's possible to write an interview script that gets stuck in an infinite loop. For example:

Dim i i = 1 While (variable <> 10) i = i + 2 End While

In this case the variable 'i' never has the value 10 and so the loop never exits. An interview that gets stuck in an infinite loop consumes a lot of processor resources and would run for ever. The MaxOpcodesExecuted property prevents this from happening. When the number of opcodes executed reaches the limit specified by the MaxOpcodesExecuted property an error occurs and the interview is terminated.

The count of the number of opcodes executed is reset every time a question is asked.

The MaxOpCodesExecuted setting only takes effect when placed before the first Ask() statement. For example:

IOM.Info.MaxOpCodesExecuted

10000 Q1.Ask()

i

1 While (variable <> 10)

i

i + 2 End While Q2.Ask()

The MaxOpCodesExecuted setting does not take effect when placed between two Ask() statements. For example:

Q1.Ask() IOM.Info.MaxOpCodesExecuted = 10000 i = 1 While (variable <> 10) i = i + 2 End While Q2.Ask()

The MaxQuestionsOnReplay property is related in that it prevents infinite loops occurring over multiple Ask() statements.