dbTalk Databases Forums  

Positioning in display array

comp.databases.informix comp.databases.informix


Discuss Positioning in display array in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
loc
 
Posts: n/a

Default Positioning in display array - 09-29-2010 , 10:32 AM






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?

Reply With Quote
  #2  
Old   
loc
 
Posts: n/a

Default Re: Positioning in display array - 09-30-2010 , 07:13 AM






On Sep 29, 11:32*am, loc <c320... (AT) gmail (DOT) com> wrote:
Quote:
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 ]
[a1][a2 ] [a1][a2 ]

attributes
a1 = formonly.num;
a2 = formonly.name;

instructions
screen record sa[24] (
num,
name)

delimiters " "
end


What I don't like about have two columns in the array is when the user
arrows through, the cursor moves left to right, which doesn't seem
very intuitive. Should I use just one column for the screen array? Is
there any point in leaving the numbers in to number the menu items
since the user can't jump to a menu item that way.

Reply With Quote
  #3  
Old   
Marty
 
Posts: n/a

Default Re: Positioning in display array - 09-30-2010 , 02:19 PM



In article <3af87491-16fe-47b2-9750-
77aa68470b8b (AT) k10g2000yqa (DOT) googlegroups.com>, c320sky (AT) gmail (DOT) com says...
Quote:
On Sep 29, 11:32*am, loc <c320... (AT) gmail (DOT) com> 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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.