Command WR INSERT PAGE NUMBER

4D Write

WR INSERT PAGE NUMBER

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. In this parameter, you can pass one of the following constants of the WR Page number formats theme:

Format TypeVConstante (valeur)
1, 2, 3...wr 123 (0)
a, b, c...wr abc (1)
A, B, C...wr ABC (2)
i, ii, iii...wr i ii iii (3)
I, II, III...wr 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 the constant wr page number (value 0) or if you omit this parameter, the current page number will be inserted. If you pass the constant wr total number of pages (value 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;wr I II III ;wr page number)
   WR INSERT TEXT(Area;" on ")
   WR INSERT PAGE NUMBER(Area;wr I II III ;wr total number of pages)

See Also

WR GET PAGE NUMBER FORMAT, WR SET FRAME.