lbrintle@umaxc.weeg.uiowa.edu (Lee Brintle) (07/18/90)
I've read several articles in the past few pages about Informix's lack
of a vertical menu system. As with most problems in Informix, a long
workaround sometimes will let you do what Informix did not provide.
Without including all the source code (200+ lines), the basic idea is this:
DEFINE menu_opts ARRAY [ 8 ] OF
letter_choice CHAR( 1 ),
menu_choice CHAR( 20 )
END,
hot_keys ARRAY [ 8 ] OF CHAR( 1 )
Initialize each menu_choice with the option name. Leave letter_choice
blank for each option. Initialize each element of hot_keys to the
letter to be used to activate that option. For example:
LET menu_choice[ 2 ] = "Invoicing"
LET hot_keys[ 2 ] = "I"
Make a screen form that looks like the vertical menu you wish to show, and
set delimiters to " ". Make the menu_choice field DISPLAY ONLY and the
letter_choice field AUTONEXT. In the 4GL program, use an INPUT ARRAY
program to get the array. Use an AFTER ROW to check to see if a letter
was hit (compare the value of letter_choice[ arr_curr() ] with each
element of hot_keys). Use an ON KEY ( CONTROL-M ) statement to exit the
input if the user hits return.
Bonus Features:
Use BEFORE ROW to DISPLAY menu_opts[ arr_curr() ].menu_choice TO
s_menu[ scr_line() ].menu_choice ATTRIBUTE( REVERSE )
and the current option will appear in reverse video.
If you do the above, you may need to display a couple of spaces in reverse
video to hide the gap between the cursor and the menu option.
Start the options with menu_choice[ 2 ], not menu_choice[ 1 ]. Using the
cumbersome method described in the Summer, 1989 Tech Notes, position the
cursor on line 2 to begin. In the AFTER ROW clause, if the user is
on line 1 (too far up) or on the line after your last option, leave
the INPUT ARRAY statment and wrap either to the last or first option.
CAUTION: This feature is hairy and results in REAL ugly code, but it
avoids the "There are no more rows" messages (which I find REAL annoying)
and allows wraparound. It also accounts for about half the code.
If you're interested in the entire code, send me E-Mail and I'll send it back
to you, with all the extras included. If you improve on this menu, please
send me a copy of your additions so I can improve our menus also.
We use these menus quite often, and they have been tested on an
HP-Vectra 386 running Xenix, a 286 running DOS, and two different NCR Towers
running Unix. The Towers were I4GL and the HP and 286 were RDS.
Also, some notes have been posted about Informix's Tech Support. I've had
really, really diverse responses from them. I call a lot (I think they know
me by name), since we're constantly trying to do stuff Informix doesn't
want to do easily. Lately, their response time has been AWFUL. Two of
my last four calls were open for over a month (one still is!), and they've
been telling me "Yep, that sure is a problem" quite a lot.
Now, about those annoying FoxPro BROWSE commands....
Lee Brintle
Advantage Information Management
(319) 337-5200
lbrintle@umaxc.weeg.uiowa.eud
Note: Throughout this note, I've used arr_curr() in array referencing
statements. This will not work, and I did it for brevity. What is
really needed is LET ar_cur = arr_curr() and then use ar_cur (a variable)
instead of arr_curr() (a function) in array referencing statements. dab@cbnewsm.att.com (david.a.berk) (07/18/90)
In article <1895@ns-mx.uiowa.edu>, lbrintle@umaxc.weeg.uiowa.edu (Lee Brintle) writes: > I've read several articles in the past few pages about Informix's lack > of a vertical menu system. As with most problems in Informix, a long > workaround sometimes will let you do what Informix did not provide. > What I meant in my article about the lack of vertical menus was other than using a form kluge. I should have been clearer. Still, let's face it, its been >5 years since I4GL has been out and the only real change to the 4GL's form/menu features has been the addition of windows. I could write a vertical menu program in curses in a day. Hey, informix, do you want to buy a vertical menu program ? Dave Berk ..!att!emdbl1!dab *** The opinions expressed are my own PERSONAL opinions and do not reflect my employer's.