something like "automatic repeated action" in 4gl
Posted in 2001
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Triggers, Constraints & Referential Integrity, Platform-Specific Issues
Hi, I need to write program with automatic repeated action, not triggered by user. For example, every few second run some action and display results. Independently on that I must be able to move through menu and so on. Shortly, quite ordinary menu-driven program + automatic repeated action in background. I tried C routines "alarm" + "signal" but just simple move in menu seems to clear programmed alarm. I believe somebody has this solved out... Yes, and what the hell is correct way to call C routine from 4gl and vice-versa ? "not correct number of parameters /results to/from calling/called function" errors makes me really .. ehm.. not happy :-) Thanks for any help. Michal Hajek PS: HP-UX 10.20, i4gl, c4gl 7.20 -- -------------------------------------------------------------- Michal Hajek mailto:hajek@nspuh.cz --------------------------------------------------------------
Michal Hajek wrote: > I need to write program with automatic repeated action, not > triggered by user. For example, every few second run some > action and display results. Independently on that I must > be able to move through menu and so on. > Shortly, quite ordinary menu-driven program + automatic > repeated action in background. > I tried C routines "alarm" + "signal" but just simple move > in menu seems to clear programmed alarm. Known problem - I4GL uses SIGALRM for its own purposes. > I believe somebody has this solved out... Not with standard I4GL. There are two main problems: * Coordinating the display between two separate threads of control. * Having two threads of control in a single I4GL program. I4GL is not safe for multithreading. And there's no way to coordinate the display of two separate programs to a single VDU (ok, window emulating a VDU) using curses. See "The Unix-Hater's Handbook" for an extensive discussion of this defect, and many other defects, in the way Unix handles terminals. > Yes, and what the hell is correct way to call C routine > from 4gl and vice-versa ? "not correct number of parameters > /results to/from calling/called function" errors makes me > really .. ehm.. not happy :-) Well, that's an RTFM. I4GL Programmer's Reference Manual, Chapter 2, round about p2-56 IIRC (at the end of the chapter, anyway). The actual page number depends on which version of the manual you use anyway, of course -- in the v7.3 manuals, it seems to have migrated to Appendix C. But of course, you read the manual so you know that... -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"
Jonathan Leffler wrote: > > I tried C routines "alarm" + "signal" but just simple move > > in menu seems to clear programmed alarm. > > Known problem - I4GL uses SIGALRM for its own purposes. > > > I believe somebody has this solved out... > > Not with standard I4GL. There are two main problems: > > * Coordinating the display between two separate threads of control. > * Having two threads of control in a single I4GL program. I only need to trigger 4gl procedure (function), only one program and one thread is running and displaying something. It is all about how to trigger some 4gl function repeatedly... > > > Yes, and what the hell is correct way to call C routine > > from 4gl and vice-versa ? "not correct number of parameters > > /results to/from calling/called function" errors makes me > > really .. ehm.. not happy :-) > > Well, that's an RTFM. I4GL Programmer's Reference Manual, Chapter 2, > round about p2-56 IIRC (at the end of the chapter, anyway). The actual > page number depends on which version of the manual you use anyway, of > course -- in the v7.3 manuals, it seems to have migrated to Appendix C. > But of course, you read the manual so you know that... > Hm.. it does not seem to be in "release" directory.. I will have to search on net :-) Thank you, Michal -- -------------------------------------------------------------- Michal Hajek mailto:hajek@nspuh.cz --------------------------------------------------------------
Michal Hajek wrote: > > Jonathan Leffler wrote: > > > Yes, and what the hell is correct way to call C routine > > > from 4gl and vice-versa ? "not correct number of parameters > > > /results to/from calling/called function" errors makes me > > > really .. ehm.. not happy :-) > > > > Well, that's an RTFM. I4GL Programmer's Reference Manual, Chapter 2, > > round about p2-56 IIRC (at the end of the chapter, anyway). The actual > > page number depends on which version of the manual you use anyway, of > > course -- in the v7.3 manuals, it seems to have migrated to Appendix C. > > But of course, you read the manual so you know that... > > > > Hm.. it does not seem to be in "release" directory.. I will > have to search on net :-) The release directory contains release notes. The manuals are available at http://www.informix.com/answers -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"