os_print - selecting multiple copies

rforst

New Member
We are currently running PROGRESS 9.1C on Windows NT. I only get one copy of my print out when I select multiple copies in the dialog box. I don't see any parameter in os_print for multiple copies. Any suggestions other than running os_print "X" number
of times?
 

rforst

New Member
_osprint.p is located in the
PROGRESS PROGRAMMING HANDBOOK
SECTION 7 Alternate I/O Sources

7.2.8 A Printing Solution
The Progress ADE toolset provides a portable solution for printing text files. The solution is a procedure called _osprint.p and it is located in the adecomm directory in the Progress product directory (DLC). You can also access the source code for this procedure in the src/adecomm directory located in the Progress product directory.
The _osprint.p procedure sends a specified text file to the default printer as paged output. Input parameters for the procedure allow you to specify values that configure a print job. On Windows, you can also direct the _osprint.p procedure to display the Print dialog box and print the text in a specified font. Use the following syntax to call the _osprint.p procedure from a Progress procedure:

SYNTAX
RUN adecomm/_osprint.p
( INPUT parentWindow , INPUT printFile ,
INPUT fontNumber , INPUT PrintFlags . INPUT pageSize ,
INPUT pageCount , OUTPUT result ).

The parameters of the _osprint.p procedure are as follows:

INPUT parentWindow
A window handle identifying the parent window for Print dialog box and any print status messages on Windows. The procedure ignores a value specified for this parameter in character interfaces. If you specify the unknown value (?) or an invalid handle on Windows, the procedure uses the CURRENT-WINDOW handle.
INPUT printFile
A string value representing the name of a text file to print. You can specify an absolute or relative path for the file. The _osprint.p procedure uses the PROPATH to locate the file.
INPUT fontNumber
An integer value representing an entry in the font table maintained by the FONT-TABLE handle. The _osprint.p procedure uses the specified font to print the text file on Windows. The procedure ignores a value specified for this parameter in character interfaces. If you specify the unknown value (?) or an integer value that does not exist in the font table for Windows, the procedure uses the default system font to print the text file.
INPUT PrintFlags
An integer value that determines which printing options are used for a print job on Windows (only). You can use the values in Table 7-1. If you need to use more than one option, add the values of the options together. In all cases, the _osprint.p procedure sets the value of the PRINTER-CONTROL-HANDLE attribute of the SESSION handle to zero (0).
INPUT pageSize
An integer value representing the number of lines per page. If you specify zero (0) for this parameter, the printer determines the page size. Windows ignores this parameter and calculates the page size based on the Paper Size setting in the Print Setup dialog box and the font specified with the fontNumber parameter.
NOTE: The maximum number of character per line is 255.
INPUT pageCount
An integer value that determines if _osprint.p prints the entire text file or a range of pages from the text file on Windows. The procedure ignores a value specified for this parameter in character interfaces. If the value of this parameter is not zero (0) on Windows, Progress uses the page range specified for the current print context.
OUTPUT result
A logical value that reports the success or failure of the print job.
To call the _osprint.p procedure from a Progress procedure, you must define a variable for the result output parameter. Here is an example:

_osprint.p
/*1*/ DEFINE VARIABLE result AS LOGICAL NO-UNDO.
/*2*/ OUTPUT TO tmp.dat.
FOR EACH customer:
DISPLAY Cust-num Name Phone WITH STREAM-IO.
END.
OUTPUT CLOSE.
/*3*/ RUN adecomm/_osprint.p (INPUT ?, INPUT "tmp.dat", INPUT ?, INPUT 1,
INPUT 0, INPUT 0, OUTPUT result).
/*4*/ OS-DELETE "tmp.p".
The following list describes the important elements of the previous example:
1. Create a variable for the OUTPUT parameter of the _osprint.p procedure.
2. Generate the temporary text file to be printed. Remember to close the output stream after generating the text file.
3. Run the _osprint.p procedure to print the generated text file.
4. Delete the temporary text file.
For more information on the language elements referenced in this section, see the Progress Language Reference.
 
Top