Re: Cancelling a DELETE inside an INPUT ARRAY
Posted in 1995
In article <49k9oj$4aa@server.iadfw.net> pdutta@iadfw.net (Partha Dutta) writes: >peter@prospect.anprod.csiro.au (Peter Wiley) wrote: > >>Yes, I know we've been here before. However... > >>I'm revisiting some of my code (it works, so I'm modifying it) and once >>again I want to abort a DELETE ROW event. Stopping the SQL delete is a >>no-brainer but the array the users see is still stuffed. Very >>disconcerting and annoying. > >Why don't you just disallow the delete to ever happen >i.e.: OPTIONS DELETE KEY F25 > >This will completely disallow the delete to happen (unless you have a >keyboard with 25 function keys)! > Actually, my keyboard has 36 F keys defined. Anyway, you miss the point. This total disallow is trivially easy to do. The problem is, there are occasions where deleting a row is appropriate (for example, no data in a result field for a lab test) and others where it is totally forbidden - ie for tests with results. Yet both types will appear for a given patient. Under these circumstances, cancellation of a delete must be by program control, based on the business rules defined for the application. And to my knowledge, there's no nice & easy way to do this in 4GL. I would dearly like one. I've thought of another kludgy approach, though. Disable the DELETE KEY by shifting it and using an ON KEY clause. This will allow me to decide if the delete is appropriate or not and shift all rows up by 1 if it is, then redisplay to the screen array. Still not nice. Peter Wiley