vcSwitchCaseStatement

A vcSwitchCaseStatement executes the first vcCaseScope for which the value of its CaseCondition property matches that of statement’s Condition property.

Inherits: vcStatement

Properties

Name Type Access Description
Condition Expression RW

Expression that defines the value against which the case conditions are evaluated.

See also Process Statement Expressions and Robot Statements.
Cases List of vcCaseScope RO All case scopes in this statement. Each scope has an RW property CaseCondition of type String which will be evaluated against statement’s Condition.

Methods

Name Return type Parameters Description
addCase

vcCaseScope

or

vcCaseScope

or

None

None

or

Integer index

or

Integer index,

vcCaseScope scope

Creates a new case and appends it to the end.

or

Creates a new case and inserts it to the given index. If index is less than zero or greater than the current case count, the case will be appended to the end.

or

Inserts an existing case to the given index. If index is less than zero or greater than the current case count, the case will be appended to the end.

moveCase None

vcCaseScope scope,

Integer newIndex

Moves an existing case to the new position. If the given index is less than zero or greater than the current case count, the case will be moved to the end.
deleteCase None vcCaseScope scope

Removes an existing case and deletes it.

releaseCase None vcCaseScope scope Removes an existing case.
getCase vcCaseScope Integer index Gets an existing case.

Events

Name Parameters Description
OnCaseAdded

vcCaseScope scope,

Integer index

Event that occurs when a case has been added. Provides an index where case was inserted.
OnCaseMoved

vcCaseScope scope,

Integer oldIndex,

Integer newIndex

Event that occurs when a case has been moved to a new index. Provides both old and new indices.
OnCaseRemoved

vcCaseScope scope,

Integer index

Event that occurs when a case has been removed. Provides an index case was removed from.