Re: Informix Ring Menu - Before Menu Option
Posted in 1996
Ian Goddard <igoddard@netcomuk.co.uk> writes: >Ken McCoy wrote: >> 4.) THE PROBLEM: The update and Delete options still display on the >> Menu. If the user chooses these options it will try to execute >> the code associated with these options and generate Nasty error >> messages. >> >> Is there any way, besides hardcoding flags or status variables, to >> either: >> 1.) re-execute the BEFORE MENU section of the MENU? >> Which in this case would HIDE all options except >> for "Query","Build","Options","Exit" >> 2.) Disable or Hide the options some other way? >Apart from the fact that you've given a choice of answers to your own >question, you could consider FETCHing PREVIOUS and displaying that row; >your menu options then remain valid except that they now work relative to >the new last record. What I've done is null the display variables after deleting the current record. And before proceding with any menu option that would modify the current record, I check to make sure the current record exists like so: if c_val.person_id is null then error "No Current Record" else do_something end if Okay, I suppose that hiding the menu options is more elegant, but this works. If you wanted to hide the menu options, you could do that as well. In any case, if the user selects the "Previous" option from the menu, then the display record is filled with data, and c_val.person_id would now not be null, and they could continue with an Update, Delete, whatever. -- ---------------------------------------------------------------------------- Daniel James - Database Administrator djames@statsci.com Data Analysis Prod Div of MathSoft (formerly StatSci) (206) 283-8802 x284