home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!emory!emory!not-for-mail
- From: jerry@jerry.mendota.ingr.com (Jerry Jugovich)
- Newsgroups: comp.databases.informix
- Subject: Re: defer interupt
- Message-ID: <1dtv7nINN5ra@emory.mathcs.emory.edu>
- Date: 12 Nov 92 06:03:03 GMT
- Article-I.D.: emory.1dtv7nINN5ra
- Sender: walt@mathcs.emory.edu
- Reply-To: jerry@jerry.mendota.ingr.com (Jerry Jugovich)
- Distribution: world
- Organization: Mailing List Gateway
- Lines: 105
- NNTP-Posting-Host: emory.mathcs.emory.edu
- X-Informix-List-ID: <list.1592>
-
-
- Nov 12 92
-
- Here is how I handle interupting screen reports by testing a variable in
- the page trailer section of the report. I had the need to interupt long
- screen reports.
-
- What I found was depending on the type of report by this a mean a single
- pass report or a 2 pass report the placement of the call to c_waitcr()
- was critical. If the report was a 2 pass report. By the way if you use
- group by statements this is a 2 pass report. And the call also has to be
- placed in the group by clauses.
-
- function a_report_function()
-
- declare rep_cur cursor for select * from foo
-
- foreach rep_cur into rep_var.* # global variable like foo #
-
- if rpt_c = 1 then
- let rpt_c = 0
- exit foreach
- end if
-
- output to report my_report ( rep_var.name ) # step into report #
-
- end foreach
-
- finish report my_report # step into report finish #
-
- end function
-
- report my_report ( in_group ) # report using global variables #
- # that were selected by a cursor #
-
- # must define variable even if passed #
- # a global variable ugh.... #
-
- define in_group like foo_table.foo_column
-
- output
- page length 22
- left margin 0
- right margin 132
- top margin 0
- bottom margin 0
-
- format
-
- page header
- print column 45,"THIS IS A PAGE HEADER",column 112,today
-
- on every row
-
- print column 5, "* ", global_var CLIPPED
-
- page trailer
- if rpt_c = 1 then
- return
- else
- call c_waitcr()
- end if
-
- clear screen
- display ""
-
- before group of in_group
- if rpt_c = 1 then
- return
- else
- skip to top of page
- end if
-
- end report
-
- # Function used to process all screen interupts #
-
- function c_waitcr( )
- define
- rrwait char( 1 )
-
- prompt "Press q to quit, any other key to continue. "attribute(cyan)
-
- for char rrwait
- if ( rrwait matches "[qQ]" ) then
- let rpt_c = 1
- clear screen
- return
- end if
-
- clear screen
- let rpt_c = 0
- return
- end function
-
-
- I used the debuger to follow a report. This is what worked for me.
-
-
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Mail Path: jerry@jerry.mendota.ingr.com Jerry Jugovich
- Phone: 612 681-4450 TIM Application Engineer
- Intergraph Corporation
- Mendota Heights Minnesota
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-