Re: Get A Unique # More Info
Posted in 1996
bahmed@cris.com (Basheer Ahmed) wrote: >I have 100+ UNIX users using a Informix application. >there are always some users who dont exit the main menu of the informix. >some leave their terminals in add or query mode. >.... >Is there any way I can force the users to exit from the menu. As far as I am aware there is no way of doing this in 4GL, BUT I can offer you a solution if you are prepared to cobble together a couple of 'c' functions and build them into your application. This works with INPUT statements and should (hopefully) work with MENU too. 1) Write a 'c' function that sets a timer and sends a timer signal after a nominal period of time (set this to the maximum amount of time that you want you users to remain in a menu; you could make this a parameter). 2) Write another 'c' function to handle the timer signal. On receipt of the signal set the global 4GL variable quit_flag (or int_flag - one works one doesn't I can't remember which way it is!) and return control to the 4GL code. 3) Write a 'c' function which disables the timer signal. 4) Disable INTERRUPT and QUIT using DEFER. 5) Before your menu statement call the timer set up function (1). 6) When you action a menu item, call the function to turn of the timer. 7) Add On Key (interrupt) to the menu. If int_flag is true then the timeout period has been reached and you then have control to shutdown the program or unlock the row etc. Good Luck P.S. I can post/e-mail the 'c' source and sample coding if required (I don't have it available at the time of writing).