Uses PALAPI                          ; the missing features from PALAPI.DLL
   ;----------------------------------------------------------------------------
   ; General notes:
   ;     
   ;     -> PALAPI 1.90 and above is SOLELY designed for use with PfW 5.0
   ;     -> PALAPI 1.90 and above will default the PrinterGlobalsetup() to
   ;        FALSE (1.0x did default to true), cause PALAPI has been assimilated
   ;        to OPAL's behavior of using a LOCAL printer and -setup.
   ;        Also PrnGlobalSetup() is still functional, we do NOT recommend to
   ;        use that feature, cause it may result in GDI-space loss !
   ;     -> Syntax changes have been avoided as far as possible to get your
   ;        PALAPI 1.0x-code (from PfW 4.5) running with a minimum of changes
   ;        (see next remark)
   ;     -> the .sDeviceName and .sDevicePort items of the tDevMode-Structure
   ;        in calls to PrinterOPAL..-funtions and the sNewPrinter/sNewPort
   ;        parameters in calls to PrinterSetup)-function will be DISREGARDED
   ;        by PALAPI, they're provided for compatibility to PALAPI 1.0x ONLY 
   ;        and will be dropped in future releases) !
   ;        In other words: PrinterOPAL... and PrinterSetup()-functions
   ;        ONLY HAVE EFFECT ON PARADOX's CURRENT PRINTER !!
   ;     -> PrinterOPAL... and PrinterSelect()-function will ONLY work with
   ;        printer device drivers designed at least for WIN 3.1 or above, if
   ;        a printer's device driver answers with a lower version nuimber, those
   ;        function may fail
   ;
   ;----------------------------------------------------------------------------
   ;
   ;  SYNTAX descriptions briefly:
   ;
   ;   PrinterSelect(const String <NewPrinter>,
   ;                const String {<NewPrnPort>: | ""}) SmallInt 
   ;        selects a given printer connenct at given port W/O displaying any
   ;        dialog boxes (that function was missing in PW)
   ;        
   ;  PrinterSetup(const String <NewPrinter>,
   ;                 const String {<NewPrnPort>: | ""})  SmallInt
   ;        printer setup AND settig for PW by user entry thru WIN's standard
   ;        printer driver's setup dialog box (fixes OPAL's bug of NOT saving
   ;        ALL entries of the priter setup dialogbox)
   ;
   ;  PrinterGlobalSetup(const GlobalSetups Logical) Logical
   ;        sets PALAPI to either do subsequent calls to PrinterOPALSetSetup()
   ;        in GLOBAL (=true=default all tasks are notified) or LOCAL to PW
   ;        (=false) way. See V102_xx.wri for further more details.
   ;
   ;  PrinterListenSetup(const MakePfWListen Logical) Logical
   ;        sets PFW 5.0 to listen to it's own local setings of PaperSource
   ;        and PaperOrientation, when a <report>.print() is done, avoiding 
   ;        that ugly "reset to WINDOWS defaults"
   ;
   ;  PrinterOPALGetSetup(var DevModeRec tDevMode) SmallInt
   ;        inquires the CIURRENT printer settings saving them into
   ;        the given tDevMode record (missing feature in OPAL)
   ;
   ;  PrinterOPALSetSetup(const DevModeRec tDevMode) SmallInt
   ;        direct OPAL printer change AND setup WITHOUT ANY dialog box 
   ;----------------------------------------------------------------------------
   ;
   ; Error values for the Printer.....() functions:
   ;
   ;  value                   meaning
   ; ------------------------------------------------------------------------
   ;   0 = ERR_NOERR        NO ERROR, everything's OK, new printer has been 
   ;   1 = ERR_ALLOCFAILED    allocation for temporarily used memeory has 
   ;                          failed (NO ACTION taken)
   ;   2 = ERR_PARM           ivalid or missing parameter types or wrong USES
   ;                          declaration (missing return type; NO ACTION taken)
   ;   3 = ERR_PARMCONTENS    invalid paraneter contents or no match found
   ;                          (NO ACTION taken)
   ;   4 = ERR_CANNOTCONVERT  (shouldn't occur) LONGINT as return-type ?
   ;                          (NO ACTION taken)
   ;   5 = ERR_CANNOTCONVERT  USER ABORT, you pressed ABORT/CANCEL from 
   ;                          printer driver's setup
   ;                          (NO ACTION taken)
   ;  99 = ERR_PALFAILED    PALSRV.DLL failed to reInit the Printer
   ;
   ;----------------------------------------------------------------------------
   ;     
   ;  DETAILED SYNTAX descriptions:
   ;     
   ;----------------------------------------------------------------------------


   ;----------------------------------------------------------------------------
   ; CPTR  PALAPI_GetVersion()
   ;----------------------------------------------------------------------------
   ; purpose:   retrieves PALAPI's version information
   ;  
   ; returns:
   ;  name        type           desciption
   ;----------------------------------------------------------------------------
   ;              CPTR           Version of PALAPI like:
   ;                             "E 1.92"     trial version
   ;                             "R 1.92"     registered versions
   ;----------------------------------------------------------------------------
   PALAPI_GetVersion() CPTR

   ;----------------------------------------------------------------------------
   ; SmallInt PrinterSelect(const String <NewPrinter>,
   ;                        const String {<NewPrnPort>: | ""}) 
   ;----------------------------------------------------------------------------
   ; purpose:   select Printer by an OPAL statement, same as a manual
   ;           MenuFilePrinterSetup menuaction 
   ;  
   ; parameters:
   ;  name        type           desciption
   ;----------------------------------------------------------------------------
   ;  NewPrinter  const String name of new printer;
   ;                             NOTE: the entry is checked by PALAPI (see below)
   ;  NewPrnPort  const String   name of new ouput port (i.e. "LPT1:")
   ;                             NOTE: the entry is checked by PALAPI (see below)
   ;                                   the entry can be ommitted by setting to ""
   ;                                   if entry is filled it MUST contain trailing 
   ;                                   colon (":")
   ;
   ;  NOTES:   the <NewPrinter> parameter is checked against the entries in  
   ;           [devices] section of your WIN.INI. The check is done ONLY up to 
   ;           the lenth of <NewPrinter>. I.e. <NewPrinter> = "HP DeskJet" will
   ;           match "HP DeskJet", "HP DeskJet 500" and "HP DeskJet 510". The
   ;           entry which is finally taken is determined by two factors:
   ;
   ;              1) does the <NewPrnPort> match the entry in [devices];
   ;                 this is ONLY valid if <NewPrnPort> != "" !!!
   ;              2) by the order of occurrance, if more than one entry matches
   ;                 <NewPrinter> and <NewPrnPort>.
   ;
   ;           This is: thwe first entry of [devices] section in your WIN.INI
   ;           that matches the <NewPrnPort> (if provided and the <NewPrinter>
   ;           up to significant len given by <NewPrinter> parameter is taken.
   ;           Please be aware, that conmfort has it price and i.e.:
   ;  
   ;           PrinterSelect("HP","") will result in FIRST "HP" printer or 
   ;           plotter or scanner or antything else in [devices] section 
   ;           of your WIN.INI regardless of what PrinterPort is specified for
   ;           that entry.
   ;           You indeed should as much characters in <NewPrinter> and/or
   ;           <NewPrnPort> as is neccesary to identify a unique entry in 
   ;           [devices] section of your WIN.INI !!
   ;
   ; return:
   ;              SmallInt       0     = OK
   ;                             other = see ERROR-descriptions above
   ;                                
   ;----------------------------------------------------------------------------
   PrinterSelect(const NewPrinter String,const NewPort String) SmallInt

   ;----------------------------------------------------------------------------
   ; SmallInt PrinterSetup(const String <NewPrinter>,
   ;                       const String {<NewPrnPort>: | ""}) 
   ;----------------------------------------------------------------------------
   ; purpose:   Setup of OPAL's current printer, using WIN 3.1
   ;           STANDARD interface; same as a manual MenuFilePrinterSetup 
   ;           menuaction WITH change setup;
   ;           This functions works with ALL features (OPAL's feature is same
   ;           but buggy; paper-source, mem, cassetes and so on are NOT saved)
   ;
   ;  NOTES:    1) you can specify copies but this entry will be lost, 'cause 
   ;  1.90++      it's overwritten by OPAL's PrintInfo-structure everytime
   ;              you'll print anything
   ;  1.90++   2) BOTH PARAMETERS ARE DISREGARDED, cause V 1.90 and above
   ;              SOLELY supports PfW new steategy of using printer setup 
   ;              information LOCALLY, so PrinterSetup() ALWAYS will display
   ;              the setup-dialog of PfW's currently selected printer
   ;              
   ;  
   ; parameters:
   ;  name        type           desciption
   ;----------------------------------------------------------------------------
   ;  NewPrinter  const String name of new printer;
   ;                             NOTE: DISREGARDED see notes above
   ;  NewPrnPort  const String   name of new ouput port (i.e. "LPT1:")
   ;                             NOTE: DISREGARDED see notes above
   ;
   ;
   ; return:
   ;              SmallInt       0     = OK
   ;                             other = see below
   ;                                
   ;----------------------------------------------------------------------------
   PrinterSetup(const NewPrinter String,const NewConnection String) Smallint

   ;----------------------------------------------------------------------------
   ; SmallInt PrinterOPALGetSetup(var DevModeRec tDevMode)
   ;----------------------------------------------------------------------------
   ; purpose:   inquires the current settings using the given tDevMode record
   ;           structure as a buffer to save that settings
   ;
   ;  NOTES:    1) TYPe and CONSTANT definitions can be found in TYP and CONST
   ;              sections of this object
   ;           2) this function is to provide easier access and use to WIN's
   ;              DEVMODE structure. Although you may fill the tDevMode
   ;              structure driectly, it is RECOMMENDED that yu use this 
   ;              function to first inquiry all tDevMode structures. See 
   ;              example and note in PrinterOPALSetup()
   ;   1.90++   3) the sDeviceName and .sDevicePort memebers of the tDevMode
   ;              parameter are DISREGARDED by this function, to reflect OPAL's
   ;              strategy of handling printer setup locally. This results in
   ;              PrinterOPALGetSetup() functioj will ALLWAYS return the CURRENTLY
   ;              printer's setup
   ;              
   ;  
   ; parameters:
   ;  name        type           desciption
   ;----------------------------------------------------------------------------
   ;  DevModeRec  var tDevMode a tDevMode structure which frist two elements
   ;                             contains printer's name and output port; ALL 
   ;                             other members schould be zero.
   ;                             the stuctue ALSO is used for return on success
   ;                             (members 3..15)
   ;
   ; return:
   ;              SmallInt       0     = OK
   ;                             other = see ERROR descriptions above
   ;
   ;----------------------------------------------------------------------------
   PrinterOPALGetSetup(var DevModeRec tDevMode) SmallInt

   ;----------------------------------------------------------------------------
   ; SmallInt PrinterOPALSetSetup(const DevModeRec tDevMode)
   ;----------------------------------------------------------------------------
   ; purpose:   sets all possible (not all avaliable) settings of the given
   ;           printer's driver as if the were filled by the user in a setup
   ;           dialogbox but WITHOUT displaying any dialogboxes at all
   ;
   ;  NOTES:    1) TYPe and CONSTANT definitions can be found in TYP and CONST
   ;              sections of this object
   ;           2) this function is to provide easier access and use to WIN's
   ;              DEVMODE structure. Although you may fill the tDevMode
   ;              structure driectly, it is RECOMMENDED that yu use this 
   ;              function to first inquiry all tDevMode structures. See 
   ;              example and note in PrinterOPALSetup()
   ;   1.90++   3) the sDeviceName and .sDevicePort memebers of the tDevMode
   ;              parameter are DISREGARDED by this function, to reflect OPAL's
   ;              strategy of handling printer setup locally. This results in
   ;              PrinterOPALGetSetup() functioj will ALLWAYS return the CURRENTLY
   ;              printer's setup
   ;              
   ;  
   ; parameters:
   ;  name        type           desciption
   ;----------------------------------------------------------------------------
   ;  DevModeRec  const tDevMode  a COMPETELY FILLED tDevMode structure 
   ;
   ;  NOTE:  using of the WIN DEVMODE structure to setup a devices driver (not
   ;           the device itself) is NOT easy. In fact you can directly call 
   ;           this function but if you aren't VERY familiar to WIN API function
   ;           the RECOMMENDED way is as follows:
   ;  
   ;           1) call PrinterOPALGetSetup() to get your tDevMode record filled
   ;              with the current values
   ;           2) modifiy ONLY those items you really want to change AND by using
   ;              the PROVIDED CONSTANT names (see CONST section of this object)
   ;           3) you CAN update the <.ldmFields> member but you also can leave
   ;              it unchanged (WIN then will set ALL members defined by ldmFields
   ;              which has been set PROPERLY by teh ...GetSetup() function and 
   ;              this is the recommended way)
   ;           4) issue the PrinterOPALSetSetup() function 
   ;
   ;------------------------------------------------------------------------------
   ;
   ; return:
   ;              SmallInt       0     = OK
   ;                             other = see ERROR descriptions above
   ;
   ;------------------------------------------------------------------------------
   PrinterOPALSetSetup(const DevModeRec tDevMode) SmallInt

   ;----------------------------------------------------------------------------
   ; Logical PrinterGlobalSetup(const GlobalSetups Logical)
   ;----------------------------------------------------------------------------
   ; purpose:   switches all functions which affects device mode settings
   ;           to do that changes GLOBALLY (all other tasks including 
   ;           WIN's PrintManager are inromed that the devices setup has
   ;           changed) or LOCALLY to PfW (which is the default).
   ;
   ; NOTES:     setting PrinterGlobalSetup(TRUE) is NOT RECOMMENDED, since
   ;  1.90++   PfW and/or PALAPI may loose GDI-space (about 0.7% to 3% each time)
   ;           in subsequent calls of PrinterSetup() and PrinterOPALSetSetup()
   ;  
   ; parameters:
   ;  name           type        desciption
   ;----------------------------------------------------------------------------
   ;  GlobalSetups   Logical     FALSE= DEFAULT
   ;                                all changes to printer setups are done
   ;                                SOLELY to PfW's printer setting and does 
   ;                                NOT HAVE ANY EFFECT on OTHER APPs
   ;                             TRUE = NOT RECOMMENDED (but still functional) !!
   ;                                causes subsequent calls to the 
   ;                                PrinterOPALSetSetup() function to be per-
   ;                                formed as a WINDOWS-wide GLOBAL change of
   ;                                printer's setup and PW's printer setup dialog
   ;                                values to be updated immediatly after setup
   ;                                has been changed. 
   ;                                INCLUDES a LOSS of 2-3% of GDI-ressources 
   ;                                EVERYTIME printer's setup is changed (PW-BUG)
   ;
   ; return:
   ;                 Logical     OLD setting
   ;
   ;----------------------------------------------------------------------------
   PrinterGlobalSetup(const GlobalSetups Logical) Logical

   ;----------------------------------------------------------------------------
   ; Logical PrinterListenSetup(const MakePfWListen Logical)
   ;----------------------------------------------------------------------------
   ; purpose:   avoids "reset to WINDOWS defaults" of paper-source and 
   ;           orientation, when a <report>.print() is issued.
   ;  
   ; parameters:
   ;  name           type           desciption
   ;----------------------------------------------------------------------------
   ;  MakePfWListen  const logical   TRUE:  makes PfW listen;
   ;                                FALSE:   PfW's default behavior
   ;
   ;  NOTES:   1) after a call with TRUE as paremeter, PfW will beahve as follows,
   ;  1.90++      when a <report>.print() is issued:
   ;           
   ;              1) NO ReportPrintInfo given or .orient unassigned or set to
   ;                 to PrnDefaultOrientation:
   ;           
   ;                 PaperSource and Orientation will be loaded from current
   ;                 printer-settings of PfW (as you may inspect them by 
   ;                 invoking the printer sertup dialog from PfW.
   ;           
   ;              2) ReportPrintInfo giver AND .orient set to portratt or 
   ;                 landscape values:
   ;           
   ;                 PaperSource like in 1)
   ;                 PaperOrientation is set from ReportPrintInfo.orient
   ;  
   ;  1.90++   2) STARTUP-VALUE of PrnListenSetup() IS FALSE !!!!
   ;  
   ;
   ; return:
   ;              Logical        old setting
   ;                                
   ;----------------------------------------------------------------------------
   PrinterListenSetup(const MakePfWListen Logical) Logical


endUses