You are here: Function Reference > Alphabetical Listing > B > BreakBatch

BreakBatch

Use this function to tell the Documaker Server to break the output print stream file for the current recipient batch after processing the current recipient, including post transaction banner processing.

Syntax

BreakBatch()

This procedure is typically called in the transaction banner DAL script. You must use the SetDeviceName function to specify a new device name. Otherwise, the new file has the same name as the old file and overwrites its contents.

After the GenPrint program finishes processing the current transaction, it closes the current output device file. This includes executing any post-batch banner processes. It then continues processing the recipient batch.

If you have assigned a new output device file name using the SetDeviceName function, the system will create and start writing to a new print stream file with that name. The best place to call the BreakBatch function is in the post-transaction banner DAL script.

Here is an example of DAL script logic that might appear in a post-transaction banner DAL script. This example requires that a pre-transaction banner DAL script save the current recipient name in a variable called CurrRecip, as shown here:

CurrRecip = RecipName()

The post-transaction banner DAL script would then include the following:

IF TotalSheets(CurrRecip) > 16000
#COUNTER += 1
CurFile = DeviceName()
Drive = FileDrive(CurFile)
Path = FilePath(CurFile)
Ext = FileExt(CurFile)
RecipBatch = RecipBatch()
NewFile = FullFileName(Drive,Path,RecipBatch & #COUNTER,Ext)
SetDeviceName(NewFile)
BreakBatch()
END
Note See FileDrive, FileExt, FileName, FilePath, and FullFileName for information on using DAL functions to manipulate file names.

Keep in mind...

The only DAL function actually involved in splitting the print stream is BreakBatch. The others make it easier to implement this functionality. For example, since you need to name the new print stream, you use the SetDeviceName procedure. To find the name of the current device, you use the DeviceName function. If you need to create unique file names, you can use the UniqueString function.

Note The BreakBatch and SetDeviceName functions are not applicable in Entry since it does not use the batch printing engine. The other functions, DeviceName and UniqueString, are applicable to both Entry and Documaker Server.

See also