PointerY  PostEvent

Chapter 9: Methods for the DataWindow Control

Position

Reports the position of the insertion point in a DataWindow.

To report

Use

The position of the insertion point in a DataWindow that does not have a RichTextEdit presentation style

Syntax 1 For DataWindows with standard presentation styles

The position of the insertion point or the start and end of selected text in a DataWindow whose object has the RichTextEdit presentation style

Syntax 2 For DataWindows with RichTextEdit presentation styles


Syntax 1 For DataWindows with standard presentation styles

Description

Determines the position of the insertion point in an edit control.

Syntax

long editname.Position ( ) 

Argument

Description

editname

A reference to a DataWindow control in which you want to find the location of the insertion point

Returns

Returns the location of the insertion point in editname if it succeeds and -1 if an error occurs. If editname is NULL, Position returns NULL.

Usage

Position reports the position number of the character immediately following the insertion point. For example, Position returns 1 if the cursor is at the beginning of editname. If text is selected in editname, Position reports the number of the first character of the selected text.

Position reports the insertion point’s position in the edit control over the current row and column.

NoteUsing with other controls For use of this method with other PocketBuilder controls, see Position in the PowerScript Reference.

Examples

Example 1

If mle_EmpAddress contains Boston Street, the cursor is immediately after the n in Boston, and no text is selected, this statement returns 7:

mle_EmpAddress.Position()

Example 2

If mle_EmpAddress contains Boston Street and Street is selected, this statement returns 8 (the position of the S in Street):

mle_EmpAddress.Position()

See also


Syntax 2 For DataWindows with RichTextEdit presentation styles

Description

Determines the line and column position of the insertion point or the start and end of selected text in a RichTextEdit control.

Syntax

PowerBuilder

band rtename.Position ( long fromline, long fromchar {, long toline, long tochar } 

Returns

Returns the band containing the selection or insertion point. The returned value is a value of the Band enumerated datatype (Detail!, Header!, or Footer!).





Copyright © 2004. Sybase Inc. All rights reserved. PostEvent

View this book as PDF