Re: Need help with referencing fields within a construct
Posted in 2000
As long as you don't mess with OPTIONS FIELD ORDER UNCONSTRAINED, your analysis should be correct. Oh, and there are other conditions too, such as there is a field after the last field to be skipped, and a field before hand, and there's more than one field to skip. Lose any of those and life becomes a whole heap harder. Been there; done that; codified the results; have forgotten the details but know where to go to find them. If you ever get really brave, you can write code to do seamless wrapping across three forms, so that when you go up from the first field on the third form you end up in the last field on the second. That's really rather tricky! Info Temp wrote: > June Tong wrote: > > > Can't find an 'Oops', but yes, I believe you can do this. Also "After Field > > field1", which will probably be safer, since there is no guarantee that the user > > will end up in field2 after entering field1. The "After Field field1" option, > > however, may require you to use getfldbuf() (or whatever that function is called), > > to get the contents of the buffer, since it may not yet be in 'field1'. > > Thanks, June and Jonathan for the get_fldbuf() tip. That does the trick nicely. > > The reason I'm wanting it in a 'before field' statement is to keep the user out of > certain fields based on what is in a prior field. So, before I enter a field that > pertains only to employees, I wanted to check to see if the type contained "EMPL", if > not I skip to the next valid field. This works best in a before field since I have > four optional fields to deal with and therefore don't need to know if the user is > backing up or going forward. Before I enter the first optional field, if the test > field is not "EMPL" skip all four. Before I enter the last optional field, if the > test field is not "EMPL" I skip backward to the field just before the optional ones > (the only direction you could be going to get to the fourth field is backward since > the other before field statement keeps you out from the other direction). Of course, > this only works if you have at least two contiguous fields you're skipping. > > If my logic is faulty here, please point out the better path. I may not be the > sharpest pencil in the cup, but I believe ignorance is curable. > > Thanks again for the get_fldbuf() tip, > carlos > > > > > > > June > > -- > > june_t@hotmail.com > > Back from the dead, resuscitated by Godiva chocolates... > > > > Please do not send Informix questions to this account. > > I would add 'Please do not send spam to this account' > > but I suppose I would be wasting my bits. > > -- > ------------------------------------------------------------------------------- > Carlos Benjamin, Jr. (623) 869 - 2364 > Programmer/Analyst/Consultant > Currently Assigned to Central Arizona Project mailto:inf999@cap-az.com > ------------------------------------------------------------------------------- -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN #include <disclaimer.h>