Break (command): Difference between revisions

From BR Wiki
Jump to navigation Jump to search
Line 40: Line 40:
The parameters "label:" and "line number" will cause the program to enter [[STEP mode]] when the specified element is reached.  
The parameters "label:" and "line number" will cause the program to enter [[STEP mode]] when the specified element is reached.  


The parameters "variable name", "function name", (and also array element) will cause the program to enter [[STEP mode]] when the specified element is changed.  
The parameters "variable name", "function name", (and also array element) will cause the program to enter [[STEP mode]] when the specified element is changed. BREAK var-name also displays the variable assignment like [[DISPLAY]] does, except only the first element that changed in an array will be displayed.  


BEGIN will cause the program to enter step mode upon entry.  
BEGIN will cause the program to enter step mode upon entry.  

Revision as of 16:16, 23 September 2014

For disambiguation purposes, see also Break (Config).

The Break command causes the program to go into Step mode when a variable value changes, or the specified line number is encountered. Both "BREAK variable-name" and "Display variable-name" may be active on the same variable concurrently.

Examples

The following example will force the currently loaded program to go into step mode when the execution reaches line 1025:

BREAK 1025

It can also enter step mode when a variable is changed:

BREAK totalfiles

BREAK also works with specific array elements (as of 4.16):

BREAK CUSTOMER$(6) 

Will cause a program break whenever CUSTOMER$(6) is changed.

Syntax

BREAK {[ [-p program name substring] {[<label>:[<clause>]]|[<line number>[:<clause>]]|[<variable name>]|[<function name>]|[BEGIN]} [OFF] ]|[ALL OFF]}

Examples
BREAK [ -p program-name-substring ]  BEGIN [ OFF ]  (break upon entry)
BREAK [ -p program-name-substring ]  variable-name  [ OFF ]
BREAK [ -p program-name-substring ]  line[:clause]  [ OFF ]
BREAK [ -p program-name-substring ]  label:[clause]  [ OFF ]
BREAK [ -p program-name-substring ]  FNname  [ OFF ]
BREAK ALL OFF

This command causes a break to occur upon encountering the indicated conditions. When this happens the program enters step mode.

Parameters

The -p parameter specifies which program or programs the statement pertains to. If not specified, then the full BR path to the current program is stored as the program name search string. However the substring value could be used as a mask to apply to multiple program libraries.

The parameters "label:" and "line number" will cause the program to enter STEP mode when the specified element is reached.

The parameters "variable name", "function name", (and also array element) will cause the program to enter STEP mode when the specified element is changed. BREAK var-name also displays the variable assignment like DISPLAY does, except only the first element that changed in an array will be displayed.

BEGIN will cause the program to enter step mode upon entry.

Adding the OFF parameter will return the program to RUN mode when the specified parameters (if any) are met. ALL OFF will always return the program to RUN mode.