Share via


Condition Property

Home Page (Objects)OverviewFAQReference

Applies to: Breakpoint object

Gets or sets the condition that allows a breakpoint to occur.

Syntax

object**.Condition** [=expression]

Parameters

object

An expression that evaluates to a Breakpoint object.

expression

A String representing the condition you want to set. This condition can be any valid expression. For example, in Visual C++, the expression could be "x == 3" or "a[4]! = 0."

Remarks

The Condition property has the String type and applies only to location or data breakpoints.

You cannot set a condition with the Condition property unless you first set a condition in the Breakpoint dialog box.

Example

The following example sets a condition on the first breakpoint in the Breakpoints collection:

Dim bps
Set bps = Debugger.Breakpoints
bps.Item(1).Condition("var==5")