up Inquisit Language Reference

debugBreak function

Stops script execution and opens the Debugger Watch Window.

Member of

<script>

Syntax

script.name.debugBreak(condition)

Return Type

none

Parameters

Name Type Description
condition boolean Optional. The execution stops if true, otherwise the script continues running.

Remarks

This function is intended for debugging purposes only and should never be included in a script used for data collection. The function stops execution and opens the Debugger Watch Window so that property values can be inspected at particular points in the script logic. It can also be used to determine whether particular bits of logic are ever executed. When the Debugger Watch Window is closed, script execution resumes.

Examples

The following stops the script if the user responds with the space bar (Note: 'this' represents 'trial.consent' in this context):

<trial consent>
/ onTrialEnd= {if ( this.response == 57 ) script.debugBbreak();}
</trial>

The following stops the script if performance dips below threshold (Note: 'this' represents 'trial.myTrial' in this context):

<trial myTrial>
/ onTrialEnd= {if ( this.percentCorrect <= 50% ) script.debugBbreak();}\n</trial>

The following stops the script if the number of items in a list is 0:

<trial myTrial>
/ onTrialEnd= {script.debugBbreak(list.probabilities.itemCount == 0);}
</trial>

Copyright Millisecond Software, LLC. All rights reserved.