You are here: Job and Form Set Rules Reference > JDT Rules Reference > WriteRCBWithPageCount

WriteRCBWithPageCount

Use this form set level rule to write the page count for each recipient. This rule is typically use for handling 2-up printing on AFP and compatible printers. This rule is also used for multi-mail processing.

Syntax

;WriteRCBWithPageCount;;;

There are no parameters for this rule.

You must include the following data in your RCBDFDFL.DFD file when you use this rule:

< Fields >

....

....

FieldName = CurPage

FieldName = TotPage

FieldName = AccumPage

......

......

< FIELD:CurPage >

INT_Type = LONG

EXT_Type = CHAR_ARRAY_NO_NULL_TERM

EXT_Length = 10

Key = N

Required = N

< FIELD:TotPage >

INT_Type = LONG

EXT_Type = CHAR_ARRAY_NO_NULL_TERM

EXT_Length = 10

Key = N

Required = N

< FIELD:AccumPage >

INT_Type = LONG

EXT_Type = CHAR_ARRAY_NO_NULL_TERM

EXT_Length = 10

Key = N

Required = N

Example

;WriteRCBWithPageCount;;;

This rule gets a pointer to the global variable NA_Offset. If the pointer is NULL, the system returns this message to the error file:

Error in WriteRCBWithPageCount: RCB field NA_Offset not found.

The rule then assigns the pointer it retrieved to the pRPS->POL_Offset and gets a handle to the print batch list. It then loops through this list to free the contents of the corresponding PRINT_BATCH structure if that print batch has been assigned a recipient.

The rule then checks the handle to the counter list. This handle is a global handle created by the PageBatchStage1InitTerm rule. If the handle is equal to VMMNULLHANDLE, the system returns this message to the error file:

Error in WriteRCBWithPageCount: PageBatchStage1InitTerm has not been called

The rule then checks the handle to the list of transaction records for the current batch. This handle is a global handle also created by the PageBatchStage1InitTerm rule. If this handle is equal to VMMNULLHANDLE, the system returns this message to the error file:

Error in WriteRCBWithPageCount: PageBatchStage1InitTerm has not been called

The rule then sets recipient page counts. If an error occurs, the system returns this message to the error file:

Error in WriteRCBWithPageCount:Failed to set recipient page counts

Next, the rule gets the handle of the global recipient list for the current form set and loops through the recipient list to add page counts to the GVM. The rule also gets the pointer to global variable TotPage. If this pointer is NULL, the system returns this message to the error file:

Error in WriteRCBWithPageCount: RCB field TotPage not found

Then rule then gets the handle to the print batch and recipient lists and loops through these lists. Finally, the rule loops through the list of page counts. If it cannot get the handle to the given page count, the system returns this message to the error file:

Error in WriteRCBWithPageCount: Cannot locate batch <Batch Name>.

See also