Xbasic

A5_MEMO_EDITOR Function

Syntax

Button as C = a5_memo_editor(P fp [,C title [,L readonly [,N cursor_position ]]])

Arguments

Button

The name of the last button pressed.

fp

A dot variable with a .Text sub-element.

title

The title of the Memo Editor. Character

readonly

Logical. Optional. Default = .F. .T. = The text is read only. .F. = The text can be edited.

cursor_position

Numeric. Optional. Default = 1. The initial cursor location.

Description

Opens a text editor. Used to edit memos when user clicks the pencil icon. Returns 'lastbutton' and 'insertion_point'

The A5_MEMO_EDITOR() function displays the Memo Editor. It is a wrapper for A5_MEMO_EDITOR2(). It returns the name of the last button pressed.

Example

In this example narrative is the name of a memo field on a form.In this example narrative is the name of a memo field on a form.

dim response as N
response = ui_msg_box("Narrative","Do you want to type/edit a Narrative?", UI_YES_NO)
IF (response = UI_YES_SELECTED) THEN
    choice = a5_memo_editor(narrative.field_get() )
    IF choice = "save" then
        parentform.commit()
        narrative.refresh()
    END IF
END IF

This example directly updates the table.

dim tbl as P
dim response as N
dim p as P
dim p.text as C
response = ui_msg_box("Narrative","Do you want to type/edit a Narrative?", UI_YES_NO)
IF (response = UI_YES_SELECTED) THEN
    tbl = table.current()
    p.text = tbl.narrative
    choice = a5_memo_editor(p, "Narrative")
    IF choice = "save" then
        tbl.change_begin()
        tbl.narrative = p.text
        tbl.change_end(.T.)
        narrative.refresh()
    END IF
END IF

Limitations

Desktop applications only.

See Also