Version

xamSyntaxEditor - Replay-Only Methods

Topic Overview

Purpose

This topic provides information about the xamSyntaxEditor™ control’s testable user replay-only methods.

xamSyntaxEditor Test Object Replay-Only Methods

Replay-Only methods summary chart

The following table briefly explains the replay-only methods for testing controls. Detailed information about the methods is available following the table.

Method Description

Returns a two dimensional array consisting of the line index and character index of the supplied character offset.

Returns the offset of the overall character location from the start of the file, the supplied line and character location.

GetLocationFromOffset

Description

This helper method, allows the offset location to interact with a line or character location, and reverse back to the offset location.

Parameters

The following table explains the method’s parameters followed by a code example.

Method parameter Description

iOffset

Zero-based integer value representing the overall character location offset, from the start of the syntax editor’s loaded document.

Example

This example demonstrates how to translate the character offset of 55 to a location you would call. It will return an object array such as ARRAY(``12,2).

XamSyntaxEditor("xamSyntaxEditor1").GetLocationFromOffset 55

Possible exceptions

There is no document currently loaded in the xamSyntaxEditor; required to perform this operation.

GetOffsetFromLocation

Description

This helper method, allows the line or character location to interact with the offset, and reverse back to the line or character’s location.

Parameters

The following table explains the method’s parameters followed by a code example.

Method parameter Description

aryLocation

This two dimensional array, consisting of the zero-based line index and a zero-based character index, represents a text location in the syntax editor’s loaded document.

Note
Note:

The line numbers are one-based by default.

Example

This example demonstrates how to translate the location of line number 13, and 3rd character to a character offset of your choice. It will return an integer value of the character location.

XamSyntaxEditor("xamSyntaxEditor1").GetOffsetFromLocation ARRAY(12,2)

Possible exceptions

There is no document currently loaded in the xamSyntaxEditor; required to perform this operation.

Another possibility is that the TextLocation argument [{0}] is malformed the correct format should be

:\``n iOffsetLocation | ARRAY(iLineIndex, iCharIndex).

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information about the xamSyntaxEditor control’s testable user actions and elements.

This topic provides information about the xamSyntaxEditor control’s testable user recordable methods.

This topic provides reference information about the xamSyntaxEditor control’s test object properties.

This topic provides reference information about the common enumerations used in testing the xamSyntaxEditor control.