Example 1: Simple input

The module "comment.4gl":
PUBLIC TYPE cb_comment_event FUNCTION (event STRING)
PRIVATE DEFINE cb_ce cb_comment_event

PRIVATE DEFINE the_comment VARCHAR(200)

PUBLIC FUNCTION set_event_callback(f cb_comment_event)
    LET cb_ce = f
END FUNCTION

PUBLIC FUNCTION get_comment()
    RETURN the_comment
END FUNCTION

DIALOG comment_input()
    INPUT BY NAME the_comment
        ON ACTION add_sep ATTRIBUTES(TEXT="Add sep")
           LET the_comment = the_comment || "\n---"
           IF cb_ce IS NOT NULL THEN
              CALL cb_ce("comment_changed")
           END IF
        ON ACTION clr_cmt ATTRIBUTES(TEXT="Clear")
           LET the_comment = NULL
           IF cb_ce IS NOT NULL THEN
              CALL cb_ce("comment_changed")
           END IF
    END INPUT
END DIALOG

For the complete example, see Example 3: DIALOG with SUBDIALOG.