This command places a breakpoint at a command line in a method where you want to stop execution, to check your coding for example. You can include a message with the command which is displayed in the debug window when the break occurs. The command does nothing in the Runtime version of Omnis.
When Omnis encounters a breakpoint the debugger is opened with the current method loaded and the Breakpoint command line highlighted. You can examine the value of fields and variables by right button/Ctrl-clicking on the field or variable name.
The Breakpoint command is ignored if executed on a thread running on a multi-threaded Omnis Server.
The Breakpoint command can be used in client-executed methods to set a 'hard' breakpoint in the code, but note that this will only be hit if the web browser developer tools are open. It will then break into the browser's debugger, in the JavaScript code which was generated from your client-executed method. The browser dev tools can usually be opened using the F12 key.
Conditional Breakpoints
You can make the Breakpoint command conditional by starting the command with a calculation in braces, optionally followed by the message. Execution stops only when the calculation evaluates to true; all values except zero are considered true. If the calculation is omitted, the breakpoint always stops.
The calculation can use square bracket notation and quoted strings in the same way as the calculation of an If command; the message following it can contain square bracket notation as usual. A leading open brace with no matching close brace, or empty braces, are treated as part of the message.
Stepping onto a Breakpoint whose condition is false still stops there as a normal step. Breakpoints are not hit while the condition itself is being evaluated, so a method called from the condition will not stop at its own breakpoint.
In a client executed method of a remote form, the condition is evaluated in the browser, and execution pauses in the browser developer tools only when it is true.
Conditional breakpoints can be turned off with the item “breakpointCommandCondition” in the “debugger” group of config.json (default is true). When false, a leading calculation in braces is treated as part of the message when you enter or import the command; commands that already have a condition continue to use it.
Example
For example, rather than placing the Breakpoint inside an If statement in a loop, the following code stops only when the line number is 99:
For lMyList.$line from 1 to lMyList.$linecount step 1
Breakpoint {lMyList.$line=99} reached line [lMyList.$line]
End For