Re: Getting input array scroll to go vertical before horizontal???
Posted in 1994
danielw@wybbs.mi.org (Daniel Wynalda SYSOP) writes:
>I'm sure there's an easy answer to this but it probably was put in the
>docs in a newer revision than my old Version 4.00 docs... I have an
>array at the bottom of a header/detail relationship for which I'd like
>to change the order of the scrolling. For example, rather than
>moving horzontally on this array, I'd like to go vertically on input then
>horizontally. Is there a way to set this???
>[ ] [ ] [ ] [ ] [ ]
>[ ] [ ] [ ] [ ] [ ]
>[ ] [ ] [ ] [ ] [ ]
I think I understand: you have a large array with only 1 field, and
many rows and columns of it; right? If so, the is an answer, but it's
not easy. Basically, you have to know where you are and were you want
to go, then use the oft-documents NOENTRY/NEXT ROW array trick to get
there. At the bottom of this message is my "bigpick" code, which does
most of what I think you're looking for.
=======================================================================
Dennis J. Pimple dennisp@informix.com Opinions expressed
Senior Consultant -------------------- are mine, and do not
Informix Software Inc Voice: 303-850-0210 necessarily reflect
Denver Colorado USA Fax: 303-779-4025 those of my employer.
# This is a shell archive. Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Dennis Pimple <dennisp@mantis> on Wed Nov 16 12:20:29 1994
#
# This archive contains:
# pick.per pick.4gl
#
LANG=""; export LANG
PATH=/bin:/usr/bin:$PATH; export PATH
echo x - pick.per
cat >pick.per <<'@EOF'
{
########### # INFORMIX PROFESSIONAL SERVICES
####### # ## Denver, Colorado
###### # ### ==================================================
##### # #### File: %M% SCCS: %I% %P%
#### # ##### Program: pick.4gi (pick.4gl)
### # ###### Client:
## # ####### Author: Dennis J Pimple
# ########### Date: %G% %U%
Perform screen for a generic pick operation via an INPUT ARRAY, including
the ability to move freely about the screen with arrow keys.
The uncommented code allows for input to the f000 field, but I've inserted
comments if you don't want to allow this.
}
DATABASE FORMONLY
{* set SCREEN SIZE to 25 to fool 4gl into displaying *}
{* only 1 blank line on bottom *}
SCREEN SIZE 25 BY 80
{
================================= PICK SCREEN =================================
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
[p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n][p|f000 |n]
}
ATTRIBUTES
{* This is the pick field; we'll test for arrow keys after this field *}
p = FORMONLY.pck TYPE CHAR, UPSHIFT, AUTONEXT, COMMENTS =
"Arrow keys to move, or RETURN or TAB to go to input field";
{* before adding an AUTONEXT on the column below, see the note above *}
{* the AFTER FIELD inp statement in pick.4gl. *}
f000 = FORMONLY.inp TYPE CHAR, UPSHIFT, COMMENTS =
"Input as required";
{* f000 = FORMONLY.inp TYPE CHAR, NOENTRY; *}
{* Noentry field allows us to jump row to row with a NEXT FIELD ne statement *}
n = FORMONLY.ne TYPE CHAR, NOENTRY;
INSTRUCTIONS
DELIMITERS " "
{* screen record is for 7 columns by 20 rows *}
SCREEN RECORD s_pick[140] (FORMONLY.pck, FORMONLY.inp, FORMONLY.ne)
END
@EOF
chmod 644 pick.per
echo x - pick.4gl
cat >pick.4gl <<'@EOF'
########### # INFORMIX PROFESSIONAL SERVICES
####### # ## Denver, Colorado
###### # ### ==================================================
##### # #### File: %M% SCCS: %I% %P%
#### # ##### Program: pick.4gi
### # ###### Client:
## # ####### Author: Dennis J Pimple
# ########### Date: %G% %U%
# 4gl code to provide a generic pick screen that allows freedom of
# movement with arrow keys. The uncommented code allows input into
# the inp files, but I've included commented code where I could to
# not allow thus. To include this functionality in your application,
# lose the MAIN, but include the CALL as required.
# Define a bunch of modular variables for working with functions in
# this module.
DEFINE ma_pall ARRAY[420] OF RECORD # Some even multiple of
# the records on screen.
pck CHAR(1), # AUTONEXT pick field
inp CHAR(5), # Input field
ne CHAR(1) # NOENTRY
END RECORD
DEFINE ma_pick ARRAY[140] OF RECORD # records on screen
pck CHAR(1), # AUTONEXT pick field
inp CHAR(5), # Input field
ne CHAR(1) # NOENTRY
END RECORD
DEFINE mpick_x SMALLINT # Max array size (420)
DEFINE mpick_s SMALLINT # Array recs on screen (140)
DEFINE mpick_c SMALLINT # # columns on screen (7)
DEFINE mpick_r SMALLINT # # rows on screen (20)
DEFINE mpick_t SMALLINT # Total recs filled in
#---------------------------------------------------------------------#
MAIN
# Arguments: N/A
# Purpose: Start up for pick
# Returns: N/A
#---------------------------------------------------------------------#
DEFER INTERRUPT
CALL do_pick()
END MAIN
#---------------------------------------------------------------------#
FUNCTION do_pick()
# Arguments: N/A
# Purpose: Set up for the INPUT ARRAY statement
# Returns: N/A
#-----