WR INSERT PAGE NUMBER

4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next

version 6.5.3 (Modified)


WR INSERT PAGE NUMBER (area; format{; typeNum})

ParameterTypeDescription
areaLongint4D Write area
formatIntegerFormat type
typeNumIntegerNumber to insert
0 = Page number, 1 = Total number of pages

Description

The WR INSERT PAGE NUMBER command allows you to insert, at the cursor location, a reference that displays the current page number or the total number of pages. This reference can be placed in the main text, footer or header area. You can use the WR SET FRAME command to place the cursor in whichever area you choose.

format allows you to choose the display format for the reference to insert. These formats are identical to the formats available in the Insert page number dialog.

Format TypeValue
1, 2, 3...0
a, b, c...1
A, B, C...2
i, ii, iii...3
I, II, III...4

The typeNum optional parameter allows you to insert either the current page number or the total page count of the current documet. If you pass 0 or if you omit this parameter, the current page number will be inserted. If you pass 1, the total number of pages of the document will be inserted.

Example

The following method (OddPages) is attached to a variable inserted in the footer of the current document:

      `Checking if the "Different on left and right pages" mode is already activated
   If(WR Get doc property(Area;wr different left right pages)#1)
         `If not, activating this mode
      WR SET DOC PROPERTY(Area;wr different left right pages;1)
      ALERT("Warning: the document is now in 'Different on left and right pages' mode!")
   End if
      `Setting the cursor in the left footer
   WR SET FRAME(Area;wr left footer)
      `Inserting 'Page X' in roman uppercase 
   WR INSERT TEXT(Area;"Page ")
   WR INSERT PAGE NUMBER(Area;4)
   WR INSERT TEXT(Area;" on ")
   WR INSERT EXPRESSION(Area;"WR Count(Area;11)")

See also

WR GET PAGE NUMBER FORMAT, WR SET FRAME.


4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next