Re: i4gl options
Posted in 1998
On 2 Sep 1998, Eduardo Palacios wrote: > I'm modifying some HUGE programs in i4gl. One program call a lot of library > functions and I need to add in some point a call to one function written by > me that will open an form with an "input array". I need to know how the > "insert key" and "delete key" are setted before the call to my funcion > because I will disable both keys (using options insert key f36...) and > after returning from my function I need to restore their original values. There isn't a standard way to do this. The best solution is to write some code to keep track of the current settings and to reset them as required, along the lines of: DEFINE ins_key CHAR(3) FUNCTION set_ins_key(new_key) DEFINE new_key CHAR(3) DEFINE old_key CHAR(3) IF ins_key IS NULL THEN -- Once only initialization to system default LET ins_key = "F1" END IF LET old_key = ins_key CASE new_key WHEN NULL LET new_key = ins_key -- interrogate for current value WHEN "F1" OPTIONS INSERT KEY F1 WHEN "F2" OPTIONS INSERT KEY F2 ... WHEN "F64" OPTIONS INSERT KEY F64 OTHERWISE ERROR "???" END CASE LET ins_key = new_key RETURN old_key END FUNCTION You'd need to fill in the triple dots (boring) and decide what to do about errors. Also, if you need to stack the information, that has to be done elsewhere than this function which simply tells you what the value was before you altered it. Repeat ad nauseam for other keys. The problem is identifying the places which need modifying in HUGE programs to support the convention that the key values are only ever set via the functions such as set_ins_key(). Oh, and D4GL provides the window::getoption() function which allows you to determine these values at run time, but there isn't an obvious mechanism which allows you to set the values dynamically. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn