ON CTRL-D how to use it?

Discussão em 'StackOverflow' iniciado por fdantas, Maio 20, 2016.

  1. fdantas

    fdantas Administrator Moderador

    In this program if you select item code it will display 3 fields and asks for update if you update it will update the records. upto this program was fine. i added one condition if user press CTRL + D it asks for delete question yes or no, it it is yes what you updated that fields should be blank otherwise do nothing it tried something but i am not able to do so. plz help me?

    /*Sample Item master Maintenance Program*/
    /* DISPLAY TITLE */
    {us/mf/mfdtitle.i "3+ "}
    def var l_qad like pt__qad13.
    def var l_draw like pt_draw.
    def var l_group like pt_group.
    def var ans as logical no-undo.
    form
    pt_part colon 25
    with frame a side-labels width 80.
    /* SET EXTERNAL LABELS */
    setFrameLabels(frame a:handle).

    form
    "Enter the Value of" l_qad colon 30 skip(1)
    "Enter the Value of" l_draw colon 30 skip(1)
    "Enter the Value of" l_group colon 30 skip(1)
    with frame b side-labels width 80.
    setFrameLabels(frame b:handle).
    view frame a.
    repeat with frame a:
    prompt-for pt_part
    editing:
    /* FIND NEXT/PREVIOUS RECORD */
    {us/mf/mfnp.i pt_mstr pt_part "pt_mstr.pt_domain = global_domain and pt_part" pt_part pt_part pt_part }
    if recno <> ? then
    do:
    display pt_part.
    end.
    end.
    for first pt_mstr exclusive-lock where pt_domain = global_domain and pt_part = input pt_part:
    assign l_qad= pt__qad13
    l_draw= pt_draw
    l_group= pt_group.
    disp l_qad l_draw l_group with frame b.
    update l_qad l_draw l_group with frame b.
    assign pt__qad13 = input l_qad
    pt_draw = input l_draw
    pt_group = input l_group.

    end.
    hide frame b.
    on CTRL-D ANYWHERE
    do:
    message "Please confirm delete" view-as alert-box question buttons yes-no update ans as logical.
    if ans= true then
    message "yes".
    assign pt__qad13 = ""
    pt_draw = ""
    pt_group = "".

    else
    message "no".
    end.
    end.

    Continue reading...

Compartilhe esta Página