For Programmers: Free Programming Magazines  


Home > Archive > Cobol > September 2005 > Algorithm for Page Up and Page Down logic for COBOL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Algorithm for Page Up and Page Down logic for COBOL
PradeepR

2005-09-06, 3:55 am

Has anyone worked on the page up and page down logic which has been
implemented in COBOL. Thanks in advance for any hints on the approach.

Michael Mattias

2005-09-06, 7:55 am

"PradeepR" <pradeep.ravle@gmail.com> wrote in message
news:1125981201.415165.238920@g47g2000cwa.googlegroups.com...
> Has anyone worked on the page up and page down logic which has been
> implemented in COBOL. Thanks in advance for any hints on the approach.


???

"page up" and "page down" are not COBOL concepts, so it could not have been
"implemented in COBOL"

However, many of us have written code which converts specific user actions
into a *logical* page up or page down, sometimes with keystrokes, sometimes
with a pointing device.

And 'what' is supposed to happen on 'page up' or 'page down' depends a lot
on the application.. like is this an application where you have built a
series of screens, each of which is presented to the user as a logical page?
(Example: The "Tour" application at http://www.providerpaymentpartner.com,
click on "tour" link). Or is this a list of text lines, like a text viewer
or editor (e.g, notepad)? What environment, and what user action triggers a
logical 'page up' or 'page down' action?

'fraid you haven't supplied anywhere near enough info to get you started..
except to recognize that 'page up' and 'page down' are logical actions,
rather than physical actions: User input = change display.

MCM





docdwarf@panix.com

2005-09-06, 6:55 pm

In article <3vfTe.1056$jE2.954@newssvr19.news.prodigy.com>,
Michael Mattias <michael.mattias@gte.net> wrote:

[snip]

>And 'what' is supposed to happen on 'page up' or 'page down' depends a lot
>on the application.. like is this an application where you have built a
>series of screens, each of which is presented to the user as a logical page?
>(Example: The "Tour" application at http://www.providerpaymentpartner.com,
>click on "tour" link). Or is this a list of text lines, like a text viewer
>or editor (e.g, notepad)?


Ahhhhhhh, yes... I recall long, tortured debates about this. For example:
given 24 lines per screen with four lines reserved for the header (line 1
= company name (BUMF, INC.), line = 2 inquiry name (Online Customer SNAFU
View), line 3 = day/date/time, line 4 = blank/dashes/underlines) and two
lines reserved for the footer (line 23 = instructions (PF1 = Help, PF3 =
End, PF7/PF8 = PgUp/PgDn), line 24 = error msgs (KEY UNDEFN'D or something
equally helpful) you have 18 lines left for display. Given a full screen
of something like:

01) ABLE
02) BAKER
03) CHARLIE
....
18) ROMEO

.... and the user pages down... what should be the first entry on the next
screen? Some say that since screen real-estate is very scarce it should
be the next entry, others say that in order to maintain continuity the
last entry on the first page should be repeated as the first entry on the
second page. Me, I was of the latter school; in paging down the last
should become first and in paging up the first last as it seems to cut
down on calls of 'Hey, what happened to (x) entry, I *know* that they're
out there!'

In the case above... what if there is, in actuality, no Sierra? The user
pages down and the first entry is

01) TANGO

.... and the user says 'What happened to Sierra? I *know* they're out
there!'... and then the coder gets called and has to fire up FileAid (if
it is available) to determine that Sierra, in fact, was deleted in last
w's purge of inactive accounts... in my experience when the second
screen shows

01) ROMEO
02) TANGO

.... such calls happen less often.

(Next w's topic of discussion for The Ergonomics of Screen Design is
'Flagging Errors: Inverse Video, Flashing - Emphatic Indicator or Sadist's
Tool?')

DD

Michael Mattias

2005-09-06, 6:55 pm

<docdwarf@panix.com> wrote in message news:dfk3ra$kdr$1@panix5.panix.com
wrote...
> Ahhhhhhh, yes... I recall long, tortured debates about this.


[ about sixty lines of *newsgroup* torture]

"Ask YOUR doctor if Valium is right for you...."

MCM



docdwarf@panix.com

2005-09-06, 6:55 pm

In article <u4hTe.320$au2.112@newssvr17.news.prodigy.com>,
Michael Mattias <michael.mattias@gte.net> wrote:
><docdwarf@panix.com> wrote in message news:dfk3ra$kdr$1@panix5.panix.com
>wrote...
>
>[ about sixty lines of *newsgroup* torture]
>
>"Ask YOUR doctor if Valium is right for you...."


My apologies, Mr Mattias, if questions about screen design strike you as
'*newsgroup* torture' (emphasis original); you might want to consider
going back into management.

DD

jce

2005-09-06, 6:55 pm

DD:

I agree. I'm of course SOOOO lazy that I cannot be bothered to find out
what the default is for ISPF "PAGE" option....so I always set it to "CSR" so
that I know _exactly_ what it's doing....My fear is that it is again costing
me more effort to be anal retentive than to press F1 and read the help :-)

JCE

TOP Post Only
<docdwarf@panix.com> wrote in message news:dfk3ra$kdr$1@panix5.panix.com...
> In article <3vfTe.1056$jE2.954@newssvr19.news.prodigy.com>,
> Michael Mattias <michael.mattias@gte.net> wrote:
>
> [snip]
>
>
> Ahhhhhhh, yes... I recall long, tortured debates about this. For example:
> given 24 lines per screen with four lines reserved for the header (line 1
> = company name (BUMF, INC.), line = 2 inquiry name (Online Customer SNAFU
> View), line 3 = day/date/time, line 4 = blank/dashes/underlines) and two
> lines reserved for the footer (line 23 = instructions (PF1 = Help, PF3 =
> End, PF7/PF8 = PgUp/PgDn), line 24 = error msgs (KEY UNDEFN'D or something
> equally helpful) you have 18 lines left for display. Given a full screen
> of something like:
>
> 01) ABLE
> 02) BAKER
> 03) CHARLIE
> ...
> 18) ROMEO
>
> ... and the user pages down... what should be the first entry on the next
> screen? Some say that since screen real-estate is very scarce it should
> be the next entry, others say that in order to maintain continuity the
> last entry on the first page should be repeated as the first entry on the
> second page. Me, I was of the latter school; in paging down the last
> should become first and in paging up the first last as it seems to cut
> down on calls of 'Hey, what happened to (x) entry, I *know* that they're
> out there!'
>
> In the case above... what if there is, in actuality, no Sierra? The user
> pages down and the first entry is
>
> 01) TANGO
>
> ... and the user says 'What happened to Sierra? I *know* they're out
> there!'... and then the coder gets called and has to fire up FileAid (if
> it is available) to determine that Sierra, in fact, was deleted in last
> w's purge of inactive accounts... in my experience when the second
> screen shows
>
> 01) ROMEO
> 02) TANGO
>
> ... such calls happen less often.
>
> (Next w's topic of discussion for The Ergonomics of Screen Design is
> 'Flagging Errors: Inverse Video, Flashing - Emphatic Indicator or Sadist's
> Tool?')
>
> DD



Richard

2005-09-06, 6:55 pm

> page up and page down logic

Page down for a file of records is relatively easy, you just store the
last line number/record key and then use this to position the file to
read/search forward through the file.

The hard part is the page up.

You could store the first number/key of the current page and use this
to postion the file and then use read previous if this is available,
displaying from bottom to top. Again, store away the key/number of the
first line and last line.

I usually do this with a table of 'page starts', say occurs 100. With
each page display I store the key of the last line in the next element
of this table. A Page down will use the key to start the file and read
the next few records to the screen. A Page Up will subtract 2 from the
table index (and check it is at least 1) and display the page.

If the user pages down beyond the end of the array (ie 100 pages) it
will still continue to display correctly but a page up will return to
page 99. It does have the advantage of being able to go back directly
to a specific page and it also works reasonably well when seaching.

Dave

2005-09-06, 9:55 pm

> Has anyone worked on the page up and page down logic which has been
> implemented in COBOL. Thanks in advance for any hints on the approach.


Perhaps it would be helpful if you were to first tell us what it is you're
paging up and down. A CICS screen? An ISPF dynamic area? Something else?
Generally, put the data in a TS queue, table, an RRDS VSAM file etc. and
roll the record pointer back and forth.

PradeepR

2005-09-12, 7:55 am

Thanks for the input from all. Here is more detail, I have to develop
an input screen of which will accept 12 rows and 8 columns and fields
this can go upto 999 elements. So there will be more than 1 screens.
Eg.
Heading1
x x x x x x x x
x x x x x x x x
.....
Page 1
After user enters all data he presses F10 and process this data.
I have implemented it now by calculation on table index
1. Initalize row = 3
2. Take input till line no. changes
3. Initialize col no. once line changes
4. Store all this in a single dimension table
Once user presses pageup/down
get the data from the table appropriately.

As I am not showing in update mode it was little easy to handle a bit.
Thanks Richard, Michael, Doc.

2005-09-12, 6:55 pm

In article <1126528261.466519.101960@g44g2000cwa.googlegroups.com>,
PradeepR <pradeep.ravle@gmail.com> wrote:

[snip]

>Thanks Richard, Michael, Doc.


What's this... thanking me for '*newsgroup* abuse'? How about a little
squeal of anquish, then?

You're quite welcome.

DD

Michael Mattias

2005-09-13, 7:55 am

"PradeepR" <pradeep.ravle@gmail.com> wrote in message
news:1126600232.989438.321680@g44g2000cwa.googlegroups.com...
> I have to say that English is not my first language. I thought there
> was quite a bit of good discussion up there. (except the small MCM-DD
> screen design discussion skirmish)


I'll make it bigger next time.

MCM



2005-09-13, 6:55 pm

In article <5rzVe.410$4T5.131@newssvr17.news.prodigy.com>,
Michael Mattias <michael.mattias@gte.net> wrote:
>"PradeepR" <pradeep.ravle@gmail.com> wrote in message
>news:1126600232.989438.321680@g44g2000cwa.googlegroups.com...
>
>I'll make it bigger next time.


As the Germans used to say, Mr Mattias... qualitas, non quantitas.

DD

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com