Cancelling a DELETE inside an INPUT ARRAY
Posted in 1995
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. The only solution I can see is to save the row's data in a BEFORE ROW trigger and wrap the INPUT ARRAY inside a WHILE TRUE loop. Aborting the DELETE by saving the row pos, exiting the INPUT ARRAY then shifting all rows up by 1 place in the array from the saved pos to the end of data, reinserting the saved row values in the correct position then restarting the INPUT ARRAY event. I still lose the cursor position inside the array unless I bounce down to the correct row, which is even messier though do-able. I'm pretty sure this will work, but kludge is a polite description for it. Anyone got any better solutions? HINT to Informix: How about a CANCEL INSERT/CANCEL DELETE syntax addition? Please? I'm running R4GL version 4.10 something and 4.12something, depending on where I am. If there's a syntax addition in 4.14 or later, I'll upgrade for this alone. Thanks, Peter Wiley