Re: field navigation
Posted in 1992
Path: emory!samsung!mips!sdd.hp.com!hplabs!nsc!pyramid!infmx!junet From: junet@informix.com (June Tong) Newsgroups: comp.databases.informix Message-ID: <1992Feb4.194719.7231@informix.com> Date: 4 Feb 92 19:47:19 GMT References: <paulb.695992173@p4.cs.man.ac.uk> <1992Jan24.212810.6141@elsouth.wsnc.org> Sender: news@informix.com (Usenet News) Organization: Informix Software, Inc. In article <1992Jan24.212810.6141@elsouth.wsnc.org> john@elsouth.wsnc.org (John White) writes: >paulb@p4.cs.man.ac.uk (Paul Bean) writes: > >>Is there a way to trap the direction in which the cursor is moving >>through the fields on a form (ie forwards or backwards). I basically >>want to ignore a next field x triggered by an after field y if i am >>going backwards. > >Ummmm.... No. [Explanation of why AFTER FIELD doesn't work, and a not-very-satisfactory-to-the-programmer workaround deleted] Hmmm... I replied to this some time ago, but haven't seen it. Seems to have fallen into some bit bucket somewhere. So here I go again. Sorry if I'm repeating myself. Maybe I don't understand what you're trying to do, but I don't see why AFTER FIELD wouldn't work. I'm not sure where you are going backwards from... (if you hit up-arrow after field y, or going into field y?) Given: [fielda ] [fieldy ] [fieldz] [fieldx] This should work if you're talking about up-arrow going INTO fieldy. It should go into fieldx if you didn't up-arrow into fieldy. Otherwise (if you did up-arrow into fieldy), it will go to fielda. BEFORE FIELD fieldy IF fgl_lastkey() = fgl_keyval("UP") { pressed up-arrow to get to y } THEN LET nextflag = 1 ELSE LET nextflag = 0 END IF AFTER FIELD fieldy IF nextflag = 0 THEN NEXT FIELD fieldx END IF If you're talking about up-arrow going OUT OF fieldy, try this. It should go into fieldx if you didn't up-arrow out of fieldy. Otherwise (if you did up-arrow out of fieldy), it will go to fielda. AFTER FIELD fieldy IF fgl_lastkey() != fgl_keyval("UP") THEN NEXT FIELD fieldx END IF Of course, this assumes you have version 4.10 of 4GL, otherwise all bets are off (that is, you won't be able to use fgl_lastkey or fgl_keyval, although there are some undocumented and unsupported workarounds for this too. I would simply recommend getting 4.10). June *-------------------------------------------------------------------------* | June Tong Informix Software | | Strategic Support Menlo Park, CA | | junet@informix.com or uunet!infmx!junet (415) 926-6433 | *-------------------------------------------------------------------------*