Re: 4gl -- how to refresh the screen
Posted in 1994
Alan Popiel (alan@po.den.mmc.com) wrote: : A while back in this newsgroup, I asked the Informix internals experts if : there was a particular C function call that was processed in response to : the user pressing control-R. No answer yet. I hope this function call : exists, rather than just a bunch of in-line code. Then application writers : could use the call periodically, to be sure the screen is "fresh and crisp". I wonder if the "internals experts" read this group? I'll give it a shot... My version of 4GL (4.11.UC4) does have such an internal function, but it does not exactly work if called directly, it relies on some flag being set in the curses WINDOW structure beforehand. To illustrate, the following C function redraws the display on my system: int redraw(nargs) int nargs; { extern char *curscr; if (curscr) { curscr[14] = 1; _winredraw(); } return 0; } This looks woefully non-portable, and I can't really improve on it because Informix does not disclose specifics about their WINDOW structure. That's why I have to declare the curscr variable with a generic (but incorrect) pointer type. I prefer to use the next function: int redraw(nargs) int nargs; { extern void *curscr; if (curscr) { touchwin(curscr); wrefresh(curscr); } return 0; } This gives me the same results and it is not really based on any internal knowledge of curses. But if you attempt to use it with 4GL/DOS or 4GL/Windows, all bets are off (I have zero experience with these products). I suspect that's why Informix doesn't document these techniques, they tend to be very platform and/or version-specific. : If this code is actually in-line, rather than a function, then I hope that : Jonathan Leffler, or whoever is appropriate, will add *grouping this code : into a 4GL-callable function* to the list of requested enhancements to 4GL. Everyone has their own wish list, and Informix cannot possibly satisfy them all. I would be content just to add this function to my private C library. Remember, some of the most-wanted features (like direct file I/O) still haven't been addressed by Informix. : Regards, : Alan ___________________________ : ______________________| R. Alan Popiel |__________________________ : \\ Internet: | Martin Marietta, SLS | / : \\ alan@den.mmc.com | P.O. Box 179, M/S 3810 | Std disclaimers apply. / : )Voice: | Denver, CO 80201-0179 USA | ( : / 303-977-9998 |___________________________| (But you knew that!) \\ : /________________________) (____________________________\\ -- Jeff Sturm jsturm@garnet.msen.com