Re: Querying current settings in I4GL
Posted in 1993
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration
In article <24svubINNho7@emory.mathcs.emory.edu>, Jonathan Leffler <rent2.informix.com!johnl@emory.mathcs.emory.edu> wrote: > >>>Recently someone posted a question regarding changing the accept key. >>>I have found that CONTROL-M works for ENTER on most terminals. >> >>>If memory serves the syntax is: >> >>>OPTIONS >>> ACCEPT KEY CONTROL-M >> >>I'd like to suggest to the Keepers of the Language that there be some way >>to query the value of these buggers, so one could for example, reset it back >>to <previous value>. I kludged up a set of routines, push/pop_accept_key() >>since (I find) it makes sense in certain areas to have it enter, sometimes >>escape, and sometimes nothing (control-a). But as it is, there's now way to >>know what it was before. :-( > >At the risk of causing controversy, I'm going to point out that this was >one of the points made in the huge list of I4GL required features that I >posted in February 1993. I asked for feedback on this list and, with a >few honourable exceptions, I received none. There were only 120 (+/-) >features. I asked for people to support or reject or expand or otherwise >comment on the list, and I received very little help indeed. > >There is a limit to what I can get done for you, and I can't promise that >anything will happen on this or any other issue, but I could resend the >original (100k) message again if people are interested in looking at it. >Your feedback might help. > This may be worthwhile for reposting even though it's probably avaliable via ftp from the archive. >Yours, >Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> A While back I was playing around trying to carry out the above idea, ie set and reset all options in generic functions that understood nothing about the previous settings. The following is some code that appears to do the trick for 4.00 and 4.10 I4GL (& RDS if memory serves me right) I never got to use it in anger so usual disclaimers apply etc.. mak --------------------------------snip here--------------------------------- /****************************************************************************** Sccsid : %W% Delta Date : %E% %U% Title : 4gl_opts.c Version 4 Author : Mark Kellaway Description : Used to save and restore the following main 4gl program options message line prompt line menu line (V4.1 only) comment line error line form line input wrap insert key delete key next key previous key accept key help key input attribute display attribute NB the help file setting is missing! Sccs Modifications ******************************************************************************/ static char *fgl_modname = "%M%"; #define PARM_CNT_BAD -1318 extern int errline; extern int msgline; extern int efcmtline; extern int promptline; extern int formline; extern int inputwrap; extern int _prvkey; extern int _nxtkey; extern int _inskey; extern int _delkey; extern int _hlpkey; extern int _editkey; extern int _acckey; extern int _optin_attr; extern int _optds_attr; #ifdef INFV4_1 extern int mnline; extern int _sig_sqlint; extern int _effldorder; #endif static int l_errline; static int l_msgline; static int l_efcmtline; static int l_promptline; static int l_formline; static int l_inputwrap; static int l__prvkey; static int l__nxtkey; static int l__inskey; static int l__delkey; static int l__hlpkey; static int l__editkey; static int l__acckey; static int l__optin_attr; static int l__optds_attr; #ifdef INFV4_1 static int l_mnline; static int l__sig_sqlint; static int l__effldorder; #endif save_opts(nargs) int nargs; { if (nargs != 0) fgl_fatal(fgl_modname, __LINE__, PARM_CNT_BAD); l_errline=errline; l_msgline=msgline; l_efcmtline=efcmtline; l_promptline=promptline; l_formline=formline; l_inputwrap=inputwrap; l__prvkey=_prvkey; l__nxtkey=_nxtkey; l__inskey=_inskey; l__delkey=_delkey; l__hlpkey=_hlpkey; l__editkey=_editkey; l__acckey=_acckey; l__optin_attr=_optin_attr; l__optds_attr=_optds_attr; #ifdef INFV4_1 l_mnline=mnline; l__sig_sqlint=_sig_sqlint; l__effldorder=_effldorder; #endif return(0); } reset_opts(nargs) int nargs; { if (nargs != 0) fgl_fatal(fgl_modname, __LINE__, PARM_CNT_BAD); errline=l_errline; msgline=l_msgline; efcmtline=l_efcmtline; promptline=l_promptline; formline=l_formline; inputwrap=l_inputwrap; _prvkey=l__prvkey; _nxtkey=l__nxtkey; _inskey=l__inskey; _delkey=l__delkey; _hlpkey=l__hlpkey; _editkey=l__editkey; _acckey=l__acckey; _optin_attr=l__optin_attr; _optds_attr=l__optds_attr; #ifdef INFV4_1 mnline=l_mnline; _sig_sqlint=l__sig_sqlint; _effldorder=l__effldorder; #endif return(0); } -----------------------snippity snippity snip------------------------------- -- they say that .sig files say a lot about a person - Hmmmmmmm.