Xbasic

TEXT.DELETE Function

Syntax

VariableName.OBJECT.DELETE()

Description

The OBJECT.DELETE() method is used with an Xdialog text control. It cuts the currently selected text from the contents of the VariableName text variable.

Example 

dim ptext as P
dim ptext.text as C
dim ptext.object as P
dim ip as N
if (a_dlg_button = "delete") then
    a_dlg_button = ""
    ip = ptext.object.get_cursor()
    ptext.object.delete()
    'after clicking the 'cut' button focus is on the button. we want to return focus to the edit control
    ui_dlg_ctl_goto(dlg_title,"ptext")
    if (ip <=len(ptext.text)) then
        ptext.object.set_cursor(ip)
    else
        ptext.object.set_cursorptext.text?
    end if
    a_dlg_button = ""
    'this causes the text box to scroll if the insertion point is not currently visible
    ptext.object.show_caret()
end if

Limitations

Desktop applications only.

See Also