Re: Getting last key pressed in 4GL
Posted in 1994
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Dirch Scheer (scheer@AMT10H01.stadt-mh.de) wrote: : Dirch Scheer (scheer@stadt-mh.de) wrote: : : >Date: 14 Jun 1994 08:12:45 GMT : : >Hello out there, : : >I want to implement the following mechanism with 4GL: : : >A database is polled every 3 seconds and some sums are displayed on screen. : : >This is programmed in a endless loop. In this loop I check for pressing of : : >the INTERRUPT key by checking the value of int_flag. If this button is : : >pressed the user will end the endless loop. Everything is working fine. : : >But now my question. I want to use other keys to start printing of the : : >current shown sums or to switch the display. Till now, I don't have found : : >any solution to get the last key pressed by user except the INTERRUPT key. : Michel Behna (mbehna@promus.com) wrote: : : Look at fgl_lastkey() function. I know it was undocumented and if you need the : : info I can dig it up. It returns an int ( I think, I am quoting from memory : : and mine is not as good as it used to be :-) ). : I have tried this hint, but it doesnt work. I have written a short program : shown below: <clip> : -------------------------------------------------------------------------- Not surprised to see that this did not work. There is no input statement with which to capture keystrokes. fgl_lastkey() can detect the last keystroke in an input statement. If you did this inside an INPUT statement, you would see messages. But since the INPUT statement will block waiting for keystrokes, you will not be able to do the 3-second poll.a I don't believe that with 4GL you will be able to do what you want. : I expected to see messages when pressing any key. But all I get is the : abort-message when hitting the DeleteChar. : Have I done something wrong??? : Are there any other solutions for the problem??? : Shall I change the programming language??? :-) I have written this routine in various dialects of assembler and C. Set an interrupt timer and do non-blocking i/o inside a loop. Handle keystokes inside the loop; when the timer interrupts, poll the database and update the screen, reset the timer, etc. DCT -- @ David Tomlinson @ @ dtomlnsn@netcom.com @ @ "By day fantastic birds flew through the petrified forest, and @ @ jeweled crocodiles glittered like heraldic salamanders on the @ @ banks of the crystalline river. By night the illuminated man @ @ raced among the trees, his arms like golden cartwheels, his @ @ head like a spectral crown...." @