Re: Abort Delete in INPUT ARRAY
Posted in 1994
Topics: Stored Procedures & SPL
dan@binford.chg.mcd.mot.com (Dan Beck) writes: I am following up on my own article because an answer struck me like a ton of bricks. >I am trying to write an application that uses arrays. >As part of the application I want the user to >press the DEL key and delete a row on the screen. >However, I want to give the user a chance to abort the >Deletion. I tried putting doing the following: > BEFORE DELETE > DISPLAY "ARE YOU SURE?" > INPUT ans FROM ans > IF ans = "Y" > THEN > NEXT FIELD next_field > END IF > AFTER DELETE > . > . > . > . > . > . What you have to do is as follow: 1. Put the INPUT ARRAY statement in an infinite while loop. 2. In the BEFORE DELETE clause, ask the question "DO you really want to delete?" If the answer is yes, then EXIT INPUT. This is not the most elegant code. INFORMIX should allow return codes from the BEFORE INSERT and BEFORE DELETE to either go or not go ahead with the DELETE or INSERT. By doing the EXIT INPUT, the cursor will be positioned on the first line (bummer). But so far that's all I come up with. Any one else have a better answer. I am running 4.1 -- Dan Beck Motorola Computer Group Office Phone: 708-576-8871 1100 Woodfield Rd., Suite 334 FAX: 708-576-8875 Schaumburg, Il 60173 INTERNET: dan@chg.mcd.mot.com