Question on Delete
David Frederick (714)639-9951 x132
David_Frederick@WYCLIFFE.ORG
Thu, 26 Feb 1998 14:50:25 +0000 (GMT)
On 25-Feb-1998 Terry Pickering wrote:
>I don't know why I always have so much with these dang things! .....
>
>I have a quick screen (Alpha, 7.10F3) that has the following code in it.
>The screen has a primary record, then a detail with a cluster of 10
>records. The problem is when I try to delete an individual line in the
>cluster by fieldmarking. It always prompts for the id range and I can't get
>it to allow me to select the record by fieldmarking.
>
>In the example below, the "Modify/Existing Records" works fine. It allows
>me to use the cursor arrows to select the record to change, etc. The
>"Delete/Entire Transaction" works fine. It deletes the primary record and
>all the detail records. The "Delete/Individual Line" works, EXCEPT it
>requires I put the starting and ending ID numbers in (I hate doing that!)
>The "Delete/Individual Line TEST" is the one I've been playing around with
>to see if I can get it to work the way I want.
>
>I've tried putting different options on the MENUITEM line itself, with no
>luck. I've tried different varities of the PUSH by putting them on the same
>line, in reverse order -- every which way and combination I could think of
>- Noluck. Any suggestions?
>
Terry,
I haven't tested this, but this might work:
TEMP T_DELETE_INDIV_FLAG CHAR*1 RESET AT STARTUP INITIAL "N"
ACTIONMENU LABEL "Delete "
MENUITEM LABEL "Individual Line" ACTION DESIGNER DELI
FILE file PRIMARY
FILE file DETAIL OCCURS #
PROCEDURE DESIGNER DELI
BEGIN
LET T_DELETE_INDIV_FLAG = "Y"
END
; ***Replace 01 with beginning ID number of cluster
PROCEDURE DESIGNER 01
BEGIN
IF T_DELETE_INDIV_FLAG = "Y"
THEN BEGIN
PUSH DELETE MARK, UPDATE STAY, ACTIONBAR
LET T_DELETE_INDIV_FLAG = "N"
END
ELSE BEGIN
ACCEPT field
ACCEPT field
.
.
.
END
END
This code will put the user in fieldmark mode and when they select a detail
record, it will be deleted. Note that selecting a field from the primary file
will do the normal action of allowing the user to edit the field's contents,
which could be confusing. It could be tweaked to do other things (like allowing
the user to delete multiple non-sequential detail records at a time while in
fieldmark mode), but this is the basic idea.
That would do the delete in one shot rather than having to mark the record, go
back to the Actionbar, and select a delete option.
Thanks,
David Frederick
Computer Systems Manager
Wycliffe Associates
Internet: David.Frederick@wycliffe.org
----
Disclaimer: Opinions expressed may not reflect those of my employer.