Xbasic

TEXT.SELECT Function

Syntax

VariableName.OBJECT.SELECT( Starting_Position as N, Length as N )

Description

The OBJECT.SELECT() method is used with an Xdialog text control. It highlights text in the VariableName text variable.

Example 

dim ptext as P
dim ptext.text as C
dim ptext.object as P
dim start_pos as N
dim len as N
dim flag_ok as L
if a_dlg_button = "select_text" then
    a_dlg_button = ""
    start_pos = 1
    len = 10
    flag_ok = .f.
    ui_dlg_box("Select Text","Start Position |[.5start_pos];Length |[.5len];{lf};| ",<<%txt%
    if (a_dlg_button = "ok") then
        flag_ok = .t.
    end if
%txt%)
    if flag_ok = .t. then
        ptext.object.select(start_pos, len)
    end if
end if

Limitations

Desktop applications only.

See Also