RE: get_fldbuf(variable-field-name)
Posted in 1997
Jake, the following snippet comes straight from the fglc2 precompiler and shows the expansion of get_fldbuf static _EFFIELD _sqfldlst[] = { /* * SQL SEES BLOCK BEGINNING */ /* * SQL SEES BLOCK ENDING */ {".customer",0}, /* * SQL SEES BLOCK BEGINNING */ /* * SQL SEES BLOCK ENDING */ /* * SQL SEES BLOCK ENDING */ {0}}; fgl_nret = _ef_fldbuf(_sqfldlst, &_sqicb); if (fgl_nret != 1) ... Since you will have to play with the internal workings of 4gl, my feeling is (I thought of doing something like that, years ago) that 1) whatever you do, you will only be able to do it with 4gl-c 2) you will have to write some sort of precompiler that adjusts 4gl generated c code to include a reference to the appropriate _sqicb struct All in all, if at all possible, you're better off doing it the traditional way: a huge case. HTH, Marco ____________________________________________________________________________ rem radioterapia, which I immeritately manage, seldom agrees with what I say marco greco (Catania, Italy) Work: marcog@ctonline.it rem radioterapia 39 95 447828 fax 446558 (was mar.greco@agora.stm.it) Achea 39 95 503117 --- On Tue, 15 Apr 1997 23:46:31 GMT Jacob Salomon <jake@apparel.net> wrote: Hi family, I have a problem that cannot be solved by standard 4GL. I am trying to improve upon the FourGen help subsystem in ways that I'd rather not detail right now. The main issue is that I need a uniform way to get the value in the current field at the moment the user presses a function key for field level help. FourGen has already generated the code to save the name of the current field in a "before field" clause. I'd like to use that string - the field name - to call get_fldbuf() and obtain the value currently in that field. This cannot be done in 4GL; get_fldbuf is a built-in function, not a library function. I have experimented with it: This works as documented: let mystring1 = get_fldbuf(customer) This gets a syntax error: let mystring1 = get_fldbuf("customer") This gets a run-time error, presumably because there is no field on the screen named "field_name": let field_name = "customer" let mystring2 = get_fldbuf(field_name) Somehow, I am certain that the internal workings of the 4GL libraries will give me what I want. I am prepared to call undocumented and/or C functions to get what I want here. I don't think I need to worry too much about changes in the release, unless Informix plans a release 7 of 4GL. And maybe it's high-time to document them. I would gleefully write 4GL wrappers for them and rebuild fglgo and fgldb in order to use them. Can anyone tell me what C functions I can call, as well as their calling sequences, that will retrieve the value in a field named in a function? Remember when get_fldbuf() was undocumented? Yuchh! Maybe it's time to release these functions to the general public and canonize them. Thanks for any help on this. -- -- Jake (In pursuit of undomesticated aquatic avians) +-----------------------------------------------------------+ | Impeccable Logic: A thought process which successfully | | resists chicken bites | +-----------------------------------------------------------+ -----------------End of Original Message-----------------