In article <3af87491-16fe-47b2-9750-
77aa68470b8b.RemoveThis@k10g2000yqa.googlegroups.com>, says...
>
> On Sep 29, 11:32 am, loc wrote:
> > I'm making a menu program with Informix 4GL 7.32.UC4. I'm loading all
> > the menu items into an array and then using a 'display array' so the
> > user can arrow through the items in the screen form. I would also
> > like the user to be able to jump to an item in the array by keying in
> > the associated item number which is displayed in it's own field next
> > the the item description.
> >
> > display array mv_arr to sa_menu.* attribute(current row
> > display="reverse")
> > on key(return)
> > # So we can jump to an item number, need to use variables the
> > 1,1 was just for testing
> > # call fgl_setcurrline(1,1)
> > exit display
> > end display
> >
> > let lv_ac = arr_curr()
> > return lv_ac
> >
> > The menu works if the user arrows to the item and presses return, the
> > calling function then knows what array item the user selected. I'd
> > like to somehow use fgl_setcurrline(), fgl_getkey(), fgl_lastkey(),
> > fgl_keyval, but since the last key pressed will be "return" I don't
> > see how I can get the item number the user keyed. Also while in the
> > 'display array' if any number keys are pressed it beeps so I don't
> > think 4GL keeps track of those keys. Is there anyway to do this?
>
> I assume what I was asking can't be done, my next question then is
> would a menu program like this typically have a single row for the
> array? Here is what
> my screen form looks like:
>
> database formonly
> screen
> { Menu Screen
>
>
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
> [a1][a2 ] [a1][a2 ]
That is close to what we have. We use 2 forms depending on how many
items will show (1 column or 2 columns). The forms look like this:
DATABASE formonly
SCREEN
{
[c]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
[a][a1 ]
}
ATTRIBUTES
a1=formonly.col1 TYPE CHAR;
a=formonly.choic1 TYPE CHAR;
c=formonly.sc_answer TYPE CHAR, AUTONEXT, UPSHIFT, INVISIBLE;
INSTRUCTIONS
DELIMITERS " "
SCREEN RECORD sc_menu1[13] (choic1, col1)
and the 2 column form:
DATABASE formonly
SCREEN
{
[c]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
[a][a1 ] [b][b1 ]
}
ATTRIBUTES
a1=formonly.col1 TYPE CHAR;
a=formonly.choic1 TYPE CHAR;
b1=formonly.col2 TYPE CHAR;
b=formonly.choic2 TYPE CHAR;
c=formonly.sc_answer TYPE CHAR, AUTONEXT, UPSHIFT, INVISIBLE;
INSTRUCTIONS
DELIMITERS " "
SCREEN RECORD sc_menu1[13] (choic1, col1)
SCREEN RECORD sc_menu2[13] (choic2, col2)
In production it looks like this:
SMS9000 pts007-20 Main Menu 11:52
A Comm Customer N Reports
B Email Message O Returns/Customer Service
C Estimates P Security Cashier
D Flash Sales Q Store Inventory Process
E Forecast Change R System Administration
F Forecast Exceptions S Utilities
G Forecast Sales X Exit
H Inquiry
I Installed Sales
J Labor Management
K OSH Credit Card
L Office
M Receiving
or
SMS9020 pts007-20 Inquiry 11:57
A All Store On Hands
B Other Store Onhand
C PO Inquiry
D POs By Vendor
E SKU By Vendor
F SKU Inquiry
G SKU Lookup
H Vendor Lookup
I Vendor Menu
X Exit
The cursor is sitting right after the SMSxxxx display text but the user
does not realize this because we reverse video the current line (by
default the first line). If they use the arrow keys we un-reverse video
the line and reverse video the line they move to. Pressing enter acts
like "do" or they can just chosse the letter. We also remember the last
line selected by user and if they come back to that menu that choice is
reversed. HTH.
Marty
>> Stay informed about: Positioning in display array