printbreak
Print the specified break frame.
printbreak BreakFrameName
Example: printbreak "DAY_TOTAL"
Parameters
Parameter | Data Type | Description |
---|---|---|
BreakFrameName | String | Name of the break frame whose getFocus trigger is to be activated. |
Return Values
Value | Meaning |
---|---|
<0 |
An error occurred. $procerror contains the exact error. |
0
|
getFocus trigger for the specified break frame returned a negative value. |
1
|
getFocus trigger for the specified break frame returned a positive value. |
Value | Error constant | Meaning |
---|---|---|
-401
|
<UMISERR_PRINT_BREAK>
|
An error occurred during
printbreak:
|
Use
Use in Form and Report components.
Allowed in only in the getFocus and leavePrinted triggers of an entity.
Description
The printbreak statement prints the break frame BreakFrameName. This is a report-writing statement which allows you to:
- Print a break frame instead of a named area frame or entity frame.
- Include a break frame in the print file immediately after the occurrence that has just been printed.
If the printbreak statement is issued when Uniface is not actually printing (that is, when $printing is 0), the statement is not executed and $status is set to -1. This allows report-like forms to be used interactively without having to override printbreak statements and recompile. It is better programming practice, however, to make a test on $printing.
If the printbreak statement is used in a header or footer frame, the statement is not executed and $status is set to -1.
Ejecting a Page
The following example shows how to use $lines to trigger an eject if there is not enough room left to print information:
trigger leavePrinted ; entity : INVOICE ; compare date of next occurrence compare (DATE) from "INVOICE" ; if next date different if ($result = 0) ; if less than 5 lines left, start printing on new page if ($lines < 5) eject endif ; set date in Break Frame DATE.DAYTOT = DATE.INVOICE ; print break frame for day total printbreak "DAYTOT" ; reset to zero for new day AMOUNT.DAYTOT = 0 ; if less than 10 lines left, eject after printing break frame if ($lines < 10) eject endif endif return(0) end; leavePrinted