FutureBasic Logo

<<    Index    >> FutureBasic 5

prHandle   function



Syntax:
pRecH& = prHandle

Description:
This function returns a handle to the print record. The print record (also called a "TPrint record") contains useful information about the printer and about the current print job (if any). For a complete description of the contents of the print record, see the "Printing Manager" chapter of Inside Macintosh: Imaging with QuickDraw. A few of the more useful fields from this record are listed here:
nbsp;pRecH&..prInfo.rPage
This gives the print page rectangle. You can get the width and height of the page as follows:
pageWidth = pRecH&..prInfo.rPage.right% - ¬
pRecH&..prInfo.rPage.left%
pageHeight = pRecH&..prInfo.rPage.bottom% - ¬
pRecH&..prInfo.rPage.top%

Use these numbers to determine how much room is available for text and graphics. The page rectangle is affected by the user's selections in the "Page Setup" dialog: for example, if the user selects "landscape" mode, the page width will be greater than the page height.
nbsp;pRecH&..prJob.iFstPage%; pRecH&..prJob.iLstPage%
These numbers indicate the first and last pages which the user wants to print. Your program should not print any pages outside of this range.
nbsp;pRecH&..prJob.iCopies%
The number of copies to print. This is the number of times your program should send the selected pages to the printer. Note that many newer printer drivers will always set this number to 1; such printer drivers will handle multiple copies internally.

Note:
prHandle is partially emulated for Carbon. FutureBasic creates a 120 byte handle and fills in a few standard rectangles and other values so that programs won't be so likely to break during the transition period to MacOS X. But these emulations are not something that you should depend on in all future versions of the IDE.

See Also:
def lprint