/* DISPLAY TITLE */{mfdtitle.i "2+ "}
define variable del-yn like mfc_logical initial no.
define variable fldname like code_fldname initial "txt_tax_type".
/* DISPLAY SELECTION FORM */
form
code_value label "Tax Type" colon 25 format "x(16)" skip(1)
code_desc colon 25
with frame a side-labels width 80 attr-space.
/* SET EXTERNAL LABELS */setFrameLabels(frame a:handle).
/* DISPLAY */
view frame a.
mainloop:repeat with frame a:
prompt-for code_value with frame a editing: /* FIND NEXT/PREVIOUS RECORD */ {mfnp01.i code_mstr code_value code_value fldname " code_mstr.code_domain = global_domain and code_fldname " code_fldval} if recno <> ? then display code_value code_desc. end.
/* ADD/MOD/DELETE */
find code_mstr
where code_mstr.code_domain = global_domain and code_fldname = fldname and code_value = input code_value exclusive-lock no-error.
if not available code_mstr then do: {pxmsg.i &MSGNUM=1 &ERRORLEVEL=1} create code_mstr. code_mstr.code_domain = global_domain. assign code_value. code_fldname = fldname. end.
display code_value code_desc.
ststatus = stline[2]. status input ststatus. del-yn = no.
seta: do on error undo, retry:
set code_desc go-on (F5 CTRL-D).
/* DELETE */ if lastkey = keycode("F5") or lastkey = keycode("CTRL-D") then do:
del-yn = yes. {pxmsg.i &MSGNUM=11 &ERRORLEVEL=1 &CONFIRM=del-yn} if del-yn = no then undo, retry. delete code_mstr. clear frame a. next mainloop.
end.
end. /* seta: */
release code_mstr.
end. /* mainloop: */
没有评论:
发表评论