END INPUT already!
Posted in 2000
Topics: General Discussion
steve farris wrote: > > Hello all, > > In the following code, should pressing accept /"escape" exit the input > statement? I thought it would. Nope. > input by name c1,c2,c3 > after field c3 > next field c1 > end input This says when you leave c3 goto c1 thereby remaining in the INPUT statement. > However I have to use: > ------------------------ > > input by name c1,c2,c3 > after field c3 > if (fgl_lastkey() != fgl_keyval("accept")) then {**** > why is this necessary ****} > next field c1 > end if > end input Yeah that will work. Also try this variation: input by name c1,c2,c3 after field c3 next field c1 on key (ACCEPT) exit input end input The 'ON KEY' clause will take precedence over the AFTER FIELD clause. Art S. Kagel
Hello all, In the following code, should pressing accept /"escape" exit the input statement? I thought it would. input by name c1,c2,c3 after field c3 next field c1 end input However I have to use: ------------------------ input by name c1,c2,c3 after field c3 if (fgl_lastkey() != fgl_keyval("accept")) then {**** why is this necessary ****} next field c1 end if end input -- steve farris nylon fusion guitar site at http://www.mindspring.com/~nlymbo
"Art S. Kagel" wrote: > steve farris wrote: > > > > Hello all, > > > > In the following code, should pressing accept /"escape" exit the input > > statement? I thought it would. > > Nope. > > > input by name c1,c2,c3 > > after field c3 > > next field c1 > > end input > > This says when you leave c3 goto c1 thereby remaining in the INPUT > statement. > > > However I have to use: > > ------------------------ > > > > input by name c1,c2,c3 > > after field c3 > > if (fgl_lastkey() != fgl_keyval("accept")) then {**** > > why is this necessary ****} > > next field c1 > > end if > > end input > > Yeah that will work. Also try this variation: > > input by name c1,c2,c3 > after field c3 > next field c1 > on key (ACCEPT) > exit input > end input > > The 'ON KEY' clause will take precedence over the AFTER FIELD clause. Even better, simply use: OPTIONS INPUT WRAP ON. That wraps the input statement so that when the user exits the last field (downwards), the cursor goes back to the first field. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN #include <disclaimer.h>
Jonathan Leffler wrote: > > "Art S. Kagel" wrote: > > > steve farris wrote: > > > > > > Hello all, > > > > > > In the following code, should pressing accept /"escape" exit the input > > > statement? I thought it would. > > > > Nope. > > > > > input by name c1,c2,c3 > > > after field c3 > > > next field c1 > > > end input > > > > This says when you leave c3 goto c1 thereby remaining in the INPUT > > statement. > > > > > However I have to use: > > > ------------------------ > > > > > > input by name c1,c2,c3 > > > after field c3 > > > if (fgl_lastkey() != fgl_keyval("accept")) then {**** > > > why is this necessary ****} > > > next field c1 > > > end if > > > end input > > > > Yeah that will work. Also try this variation: > > > > input by name c1,c2,c3 > > after field c3 > > next field c1 > > on key (ACCEPT) > > exit input > > end input > > > > The 'ON KEY' clause will take precedence over the AFTER FIELD clause. > > Even better, simply use: OPTIONS INPUT WRAP ON. > > That wraps the input statement so that when the user exits > the last field (downwards), the cursor goes back to the first field. OO OO! Looks like we both missed this one. Seems he must have WRAP ON already since the complaint is that the form is staying in INPUT and not exiting after the last field! He needs to turn INPUT WRAP OFF! I'm so used to having WRAP turned on that I assumed that is default behavior. Art S. Kagel