PROGRESS xPrint.i functions

<< Click to Display Table of Contents >>

Navigation:  PROGRESS users >

PROGRESS xPrint.i functions

xPrint.i

 

xPrint.i is a useful include to work with vpxPrint. Put it in the definition section of each of your vpxPrint programs.

 

toBase64():        

Converts a file to a base64 string.

Input parameters :

·File_name                AS CHARACTER

 

Returned value :

The base64 string.
The return value is a LONGCHAR with 64bit PROGRESS versions and CHAR with others.

 

centerText():        

Centers a text within an area.

Input parameters :

·<text to center>                AS CHARACTER
·<font attributes>        format: "Arial,B,10". notation <> is not used
·<area width in inches>        DECIMAL

Returned value :

The sequence to insert into your output stream.

 

rightJustify():        

right justifies a text within an area.

Input parameters :

·<text to justify>                AS CHARACTER
·<font attributes>        format: "Arial,B,10". notation <> is not used
·<area width in inches>        DECIMAL

Returned value :

The sequence to insert into your output stream.

 

decimalAlign():        

justifies a decimal text within an area. The decimal points (or commas) are the delimiters to align.

Input parameters :

·<text to justify>                AS CHARACTER for example STRING(decimal-value)
·<font attributes>        format: "Arial,B,10". notation <> is not used
·<area width in inches>        DECIMAL

 

Returned value :

The sequence to insert into your output stream.

 

reduce():        

truncates a text to fit within a given area.

Input parameters :

·<initial text>                AS CHARACTER
·<font attributes>        format: "Arial,B,10". notation <> is not used
·<area width in inches>        DECIMAL

Returned value :

The truncated text. Note that no word wrap is done.

 

This function is now included in the dll with the <TRUNCATE> tag.

 

getBackground():        

Returns a string containing all the lines in the file.

Input parameters :

·<.xpr file name>                AS CHARACTER

Returned value :

The content of the file in a string variable.

 

setDefaultPrinter():        

Sets a new Windows default printer.

Input parameters :

·<.Printer name>                AS CHARACTER

 

escapeHTML():        

Returns a string where < and > characters are replaced by \< and \> respectively.

Input parameters :

·Sequence                AS CHARACTER

Returned value :

The 'escaped' string.

 

Note: if the sequence already has \< or \> strings, they are kept.

 

mailStatus():

Returns true or false if the condition is verified.

 

PROGRESS users can use the mailStatus() function to check the mail return code.

Input parameter:

Condition_to_check:   INTEGER value

Output parameter:

True/False logical value

 

From xprint.i:

 

/*        MailStatus

 ========*/

 DEF VAR MailSent                AS INT     NO-UNDO INITIAL 1.

         DEF VAR MailError                AS INT     NO-UNDO INITIAL 2.

         DEF VAR MailSave                AS INT     NO-UNDO INITIAL 3.                

         

         DEF VAR MailAttachError AS INT     NO-UNDO INITIAL 4.

         

         DEF VAR MailOutlook        AS INT     NO-UNDO INITIAL 5.

         DEF VAR MailCDO                AS INT     NO-UNDO INITIAL 6.

         DEF VAR MailMAPI                AS INT     NO-UNDO INITIAL 7.

         

         FUNCTION mailStatus RETURNS LOGICAL  (I AS INTEGER) FORWARD.

/* ====================================================================*/        

 

IF mailStatus( MailSent ) THEN

         MESSAGE "Mail is sent" VIEW-AS ALERT-BOX.

 

loadxPrint : PROCEDURE to load the xPrint.dll in memory (uses the loadLibrary API call)

 

unloadxPrint : PROCEDURE to unload the xPrint.dll from memory (uses the freeLibrary API call)