Log In    |    Knowledge Base    |    4D Home
Tech Tip: Combining 4D Write documents
PRODUCT: 4D Write | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: April 6, 2001

In version 6.0, combining 4D Write documents into one can be done with the combination of two commands: WR Append document and WR Append break. The command WR Append document sends the 4D Write document contained in Picture to the specified document and the command WR Append break sends the page break to the specified document.

Starting from version 6.5, the commands WR Append document and WR Append break no longer exist. To append several 4D Write documents into one document, you will need to insert each 4D Write document into an offscreen area. Once the offscreen area is filled with all selected 4D Write documents, its contents can be saved into a new document with the command WR SAVE DOCUMENT.

The following example creates a document from several 4D Write documents, stored in the picture field.

` Method: Accept a name of document to be created as a parameter.

$Temp:=WR New offscreen area
ALL RECORDS([Table 1])
$Total:=Records in selection([Table 1])
If ($Total>0)
For ($i;1;$Total)
$err:=WR Insert picture area ($Temp;[Table 1]wPic_;1)
NEXT RECORD([Table 1])
End for
If (Test path name($DocName)=1)
WR SAVE DOCUMENT ($Temp;$eDoc;"4WR7")
WR SAVE DOCUMENT ($Temp;$DocName;"4WR7")
End if
End if

This method reads and inserts each 4D Write document (in picture) into an offscreen area. At the end of the process, it saves the content of the offscreen area as a new document.