Up Arrow doesn't work on form
Posted in 2006
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
I have created my first form and 4GL report, but when navigating the form the up arrow key doesn't put the cursor to the previous field. I can only go forward through the fields with either enter, down arrow or right arrow. Isn't it a default for up arrow or left arrow to go to the previous field? The report and form were compiled with compiled 4gl 7.32 on Slackware Linux. I tried setting TERMCAP=$INFORMIXDIR/etc/termcap, but that didn't help. database formonly screen { Report Destination: [f000 ] Start Date: [f001 ] End Date: [f002 ] Schedule Code: [f003 ] (G)as, (D)iesel, (K)erosene: [a] } end attributes f000 = formonly.rptdest type char, default = "laser", required, comments = "Enter printer name or S to display to screen"; f001 = formonly.mv_begin_date type date; f002 = formonly.mv_end_date type date; f003 = formonly.mv_sch_code type char; a = formonly.mv_product type char; end DATABASE dbname DEFINE mv_BEGIN_DATE DATE DEFINE mv_END_DATE DATE DEFINE mv_SCH_CODE CHAR (5) DEFINE mv_PRODUCT CHAR (1) DEFINE rptdest CHAR (25) MAIN OPEN FORM txr8849 FROM "txr8849" DISPLAY FORM txr8849 INPUT BY NAME rptdest INPUT BY NAME mv_begin_date INPUT BY NAME mv_end_date INPUT BY NAME mv_sch_code INPUT BY NAME mv_product CALL run_report_tx8849() END MAIN
Chad wrote: > I have created my first form and 4GL report, but when navigating the > form the up arrow key doesn't put the cursor to the previous field. I > can only go forward through the fields with either enter, down arrow or > right arrow. Isn't it a default for up arrow or left arrow to go to > the previous field? The report and form were compiled with compiled > 4gl 7.32 on Slackware Linux. I tried setting > TERMCAP=$INFORMIXDIR/etc/termcap, but that didn't help. > > database formonly > > screen > { > Report Destination: [f000 ] > Start Date: [f001 ] > End Date: [f002 ] > Schedule Code: [f003 ] > (G)as, (D)iesel, (K)erosene: [a] > } > end > > attributes > f000 = formonly.rptdest type char, default = "laser", required, > comments = "Enter printer name or S to display to screen"; > f001 = formonly.mv_begin_date type date; > f002 = formonly.mv_end_date type date; > f003 = formonly.mv_sch_code type char; > a = formonly.mv_product type char; > end > > > > DATABASE dbname > DEFINE mv_BEGIN_DATE DATE > DEFINE mv_END_DATE DATE > DEFINE mv_SCH_CODE CHAR (5) > DEFINE mv_PRODUCT CHAR (1) > DEFINE rptdest CHAR (25) > > MAIN > OPEN FORM txr8849 FROM "txr8849" > DISPLAY FORM txr8849 > INPUT BY NAME rptdest > INPUT BY NAME mv_begin_date > INPUT BY NAME mv_end_date > INPUT BY NAME mv_sch_code > INPUT BY NAME mv_product > CALL run_report_tx8849() > END MAIN Working from memory - check the manual. Since you don't specify OPTIONS INPUT WRAP, each input statement deals with a single field, and any use of the up or down arrow keys moves onto the next input statement - and that in itself precludes going backwards. Use a single input statement: INPUT BY NAME rptdest, mv_begin_date, mv_end_date, mv_sch_code, mv_product You might also want to add OPTIONS INPUT WRAP to the code. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
Jonathan Leffler wrote: > > Since you don't specify OPTIONS INPUT WRAP, each input statement deals > with a single field, and any use of the up or down arrow keys moves onto > the next input statement - and that in itself precludes going backwards. > > Use a single input statement: > > INPUT BY NAME rptdest, mv_begin_date, mv_end_date, > mv_sch_code, mv_product The single input statement worked, I can now arrow back through the fields. > > You might also want to add OPTIONS INPUT WRAP to the code. I also added this. How is executing a report typically done, by having the user press ESC or should I use a ring menu option that runs the report?
On 12 Sep 2006 05:49:25 -0700, Chad <c320f@yahoo.com> wrote: > > Jonathan Leffler wrote: > > > > Since you don't specify OPTIONS INPUT WRAP, each input statement deals > > with a single field, and any use of the up or down arrow keys moves onto > > the next input statement - and that in itself precludes going backwards. > > > > Use a single input statement: > > > > INPUT BY NAME rptdest, mv_begin_date, mv_end_date, > > mv_sch_code, mv_product > > The single input statement worked, I can now arrow back through the > fields. > > > > > You might also want to add OPTIONS INPUT WRAP to the code. > > I also added this. How is executing a report typically done, by having > the user press ESC or should I use a ring menu option that runs the > report? There are many ways of doing it - it depends on the user requirements. Personally, I tend to make the report generator into a 'batch' process that can be run from the command line (and therefore run from cron, for example). I then provide a simple front-end like your input statements that collect the control data and format up the command line - and run the report. That doesn't always work well for reports to screen (the reasons are manifold and complex). Most people probably go for a menu option to start collecting the report, and either an ACCEPT key (default, ESC) or a prompt to confirm that the report should be run. But if you can think of a way of doing it, the chances are, someone has done it that way. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/