How to control printing

sk_manu

New Member
HI all,

Its manu once again.. Can any one tell me how to control the printer. I.e. after printing one page it has to stop and system has to ask for confirmation to print next page, after completion of third page again it has to ask. Means after printing every page it as to ask for confirmation. I know many exp members are there in progresstalk, can any one tell me the answer to this..

Thanks & Regards

Manohar
 

joey.jeremiah

ProgressTalk Moderator
Staff member
try thinking a little bit outside the box, it's your job to come up with
solutions.

even with basic statements, you can print one page at a time i.e.

1. confirm, print page or leave
2. output to printer
3. print current page
4. output close
start over again

if it over complicates the process, you can buffer the result first into a
file, temp-table or dataset etc. hth
 

BONO

Member
Hello,
With simple text edition with graphic character, i'll do it by the use of 2 stream an a temp-table.

First stream to screen and Second to print
All output on a temp-table
First output to screen by testing line-counter of stream (for the page-size u've choose).
If u've finish page (line-counter test) then display screen
IF accept then resend you're temp-table then u don't have to read Two times you're records ....

HTH
 

joey.jeremiah

ProgressTalk Moderator
Staff member
don't have a printer to try it out right now, but any how it'll give you a general idea.

<snippet>

/* direct output to a file ( main.out ) */

OUTPUT TO main.out PAGE-SIZE 60.

PUT "Hello World" SKIP.

PAGE.

PUT "Goodbye" SKIP.

OUTPUT CLOSE. /* main.out */



/* load file into memory */

DEFINE VAR cFile AS LONGCHAR NO-UNDO.

COPY-LOB FROM FILE "main.out" TO cFile NO-CONVERT.



/* print file one page at a time */

DEFINE VAR iTot AS INT NO-UNDO.
DEFINE VAR i AS INT NO-UNDO.

ASSIGN
iTot = NUM-ENTRIES( cFile, "~f" ) - 1. /* "~f" = form feed. minus last form feed */
i = 1.



REPEAT:

/* print current page */

OUTPUT TO PRINTER NO-CONVERT.

PUT UNFORMATTED ENTRY( i, cFile, "~f" ).

OUTPUT CLOSE. /* printer */



/* if last page then leave */

IF i = iTot THEN LEAVE.

i = i + 1.



/* else confirm every additional page */

DEFINE VAR lNext AS LOGI NO-UNDO INIT YES.

MESSAGE "Print Next Page"
VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO
UPDATE lNext.

IF NOT lNext THEN LEAVE.

END. /* do i = 1 to num-entries */

</snippet>
 

sk_manu

New Member
thank u

Hi,

Thank u for u r response, u r idea is good. But iam using progress character mode v9. many commands that u gave will not work in my version. Once again thanks for u replay..
 
Top