eject

Eject a page when printing.

eject

Return Values

Values returned in $status
Value Description
-1 An error occurred. $procerror contains the exact error.
0 eject was successful.
Values commonly returned by $procerror following eject
Value Error constant Meaning
-1404 <UPROCERR_NO_PRINTING> Not printing (that is, $printing is 0). The eject statement is ignored.

Use

Use in Form and Report components.

Not allowed in the getFocus trigger of a header or footer frame.

Description

The eject statement forces a page break and causes Uniface to continue printing on the following page. It is recommended to place the eject statement in either the getFocus trigger or leavePrinted of an entity.

The eject statement is ignored in the following circumstances:

  • Uniface is not printing (that is, $printing is 0).
  • In the second or later occurrence of an entity that is painted with horizontal repetition.
  • On an empty page.
  • In the getFocus trigger of a header or footer frame.

Using eject

The following example starts a new page when the contents of the INVDATE field change:

trigger leavePrinted 
  compare/next (INVDATE) from "INVOICE"    ;test if next date the same (or exists)
  if ($result = 0)                         ;if next date exists and not the same
     eject                                 ;start printing on new page
  endif
end

Related Topics