Example

Several Reflection commands refer to row and/or column coordinates, but handle these coordinates differently. GetText and MouseRow both use host-addressable coordinates. With host-addressable coordinates, the numeric value assigned to the top row of display memory depends on the kind of terminal you are emulating. (You can use DisplayMemoryTopRow to return this value.) HotspotRow always identifies the first row of display memory as 1, regardless of the terminal you are emulating. The MouseColumn property is set to 0 when the user clicks in the first column. HotspotColumn is set to 1 after a click in the same location.

The following procedures return text associated with the most recent mouse or hotspot click, and work for all Reflection products and all terminal emulations. (The underscore line continuation character is used to break up long lines.)

'Get the text of the entire line containing the last mouse click.

Function MouseClickRowText As String

With Session

 MouseClickRowText = .GetText(.MouseRow, 0, .MouseRow, _

    .DisplayColumns - 1)

End With

End Function

 

'Get the character at the last mouse click.

Function MouseClickCharacter As String

With Session

 MouseClickCharacter = .GetText(.MouseRow, .MouseColumn, _

    .MouseRow, .MouseColumn)

End With

End Function

 

'Get the text of the entire line containing the last hotspot used.

Function HotspotRowText As String

With Session

 HotspotRowText = .GetText(.DisplayMemoryTopRow + .HotspotRow - 1, 0, _

    .DisplayMemoryTopRow + .HotspotRow -1 , .DisplayColumns - 1)

End With

End Function

 

'Get the first character of the last hotspot used.

Function HotspotFirstCharacter As String

With Session

 HotspotFirstCharacter = .GetText(.DisplayMemoryTopRow + .HotspotRow - 1, _

    .HotspotColumn - 1, .DisplayMemoryTopRow + .HotspotRow -1 , _

    .HotspotColumn - 1)

End With

End Function